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: custom rollup config #69

Merged
merged 64 commits into from
Sep 19, 2024
Merged

feat: custom rollup config #69

merged 64 commits into from
Sep 19, 2024

Conversation

zobront
Copy link
Collaborator

@zobront zobront commented Aug 22, 2024

Add support for a rollups outside of the superchain-registry via a dynamic RollupConfig.

Overview

Program Changes

  • The fault-proof and range programs now take in a BootInfoWithBytes config that contains the rollup_config_bytes. These bytes are hashed inside of the program to get the rollupConfigHash which is committed to within the rollupConfigStruct. The RollupConfig is used in the BlockExecutor.
  • The aggregation program verifies that the rollupConfigHash committed to in each range proof is the same, and the rollupConfigHash is then verified to match the one stored in the contract on-chain. This guarantees that only 1 rollupConfigHash can be used at a time.

Script Changes

  • Whenever the fetcher is initialized, save the rollup config for the corresponding chain to rollup-configs/{chain_id}.json. This path is used during witness generation, so it's important that the relevant rollup configuration is present at that path.
  • Modify the BootInfoStruct to include the rollup_config_hash.

Contract Changes

  • Add a check for the rollupConfigHash whenever proposeL2Output root is called on ZKL2OutputOracle.
  • Before reading the zkl2ooconfig.json, build & invoke the fetch-rollup-config binary, which updates the vkey, startingBlockNumber, chainId, l2BlockTime, rollupConfigHash, startingOutputRoot and startingTimestamp. To use a manually set startingBlockNumber, set USE_CACHED_STARTING_BLOCK in your environment.

Miscellaneous

  • Add support for using the cached starting block in the zkl2ooconfig.json, rather than re-initializing it.
  • Fix an issue in the cost estimator that didn't handle span batches with the same start and end block.
  • Remove unnecessary TODO's and unused documentation from the book.
  • Exit the native_host_runner correctly.
  • Remove the annotation for the ec_recover precompile as it's infrequently used.
  • Move .env.example to the root.

TODO's

Remaining:

  • Do an E2E test of span and agg proofs with new code. Note that this will require deploying a new contract (with the rollup config hash added) to verify proofs against.
  • Update tutorial in other PR to include calling cargo run --bin fetch_rollup_config before deploying contracts.

Cargo.toml Outdated Show resolved Hide resolved
justfile Outdated Show resolved Hide resolved
@ratankaliani ratankaliani mentioned this pull request Sep 11, 2024
3 tasks
ratankaliani and others added 11 commits September 11, 2024 18:45
* load op stack rollup cfg fixes

* Parse the rust rollup config and default return the entire range

* fix: import paths for rollup cfg

* add

* update

* docs

* lint

---------

Co-authored-by: Ubuntu <ubuntu@op-sepolia-archive-1.maas>
@ratankaliani ratankaliani merged commit 9117fe0 into main Sep 19, 2024
10 checks passed
@ratankaliani ratankaliani deleted the custom-rollup-config branch September 24, 2024 23:28
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