Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: cost estimator #68

Merged
merged 35 commits into from
Aug 28, 2024
Merged

feat: cost estimator #68

merged 35 commits into from
Aug 28, 2024

Conversation

ratankaliani
Copy link
Member

@ratankaliani ratankaliani commented Aug 21, 2024

Overview

  • Add a cost estimator tool that outputs the relevant statistics across a range of blocks.

    • Maps a range of blocks into a representative workload for the OP Proposer by splitting the range into smaller segments of blocks, which are then aggregated and put on chain.
    • The aggregate proof is excluded from the statistics, as it's typically 50-60M cycles, whereas the segment proofs are 2-3B cycles.
  • Simplify the pipeline for surfacing the next relevant block.

  • Simplify program block execution logic, given that only one payload is produced at a time.

  • Add more resilient logic for timing out the execution of the native host.

@ratankaliani ratankaliani changed the title chore: test with cli feat: test with cli Aug 22, 2024
}

impl fmt::Display for ExecutionStats {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thin it would be good to print this out in a comma separated format (like a CSV file), something like this: https://github.com/succinctlabs/rsp/blob/main/bin/host/src/execute.rs

ENV PATH="${GOPATH}/bin:${PATH}"

# Set up Go environment
WORKDIR /optimism
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like the correct way to do this is to put in the optimism repo & then build the docker file from there and push the image to docker hub?

I think it's semantically a bit incorrect to clone github repos in a dockerfile lol

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah after the server is finalized can do this.

Ok(response.ranges)
}

async fn start_span_batch_server() -> Result<Child> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I feel like what's more "semantically correct" is to execute the docker command first & then this bin, instead of starting the server in bin/cost_estimator.rs

let rollup_config = RollupConfig::from_l2_chain_id(l2_chain_id).unwrap();

// Fetch the span batch ranges according to args.start and args.end
// TODO: If the ranges are greater than 20 blocks, we will have to split them in a custom way.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this because our executor is slow for large blocks?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes


let prover = ProverClient::new();

// TODO: These should be executed in parallel.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah that's a good callout--I feel like you could do a par_iter and use different threads since each executor is just single-threaded

Ubuntu and others added 5 commits August 22, 2024 23:06
@ratankaliani ratankaliani changed the title feat: test with cli feat: cost estimator Aug 27, 2024
@ratankaliani ratankaliani merged commit dd507f7 into main Aug 28, 2024
2 checks passed
@ratankaliani ratankaliani deleted the ratan/test-with-cli branch September 24, 2024 23:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants