Repository navigation
fix(aggregation mode): support SP1 v6 proofs on the local devnet - #2309
Merged
JuArce merged 1 commit intoOct 15, 2026
Merged
Conversation
Run upgrade_proof_aggregator_sp1.sh on the devnet. It deploys the SP1 v6.1.0 Groth16 verifier, adds its route to the devnet SP1 gateway and allows the new SP1 chunk aggregator vk in both proof aggregation services. The anvil states and the ethereum-package preloaded contracts are updated. The script now drops the stored transactions, which current anvil versions can't parse, and keeps the block headers. It also updates network_params.yaml, skipping the hardfork system contracts that anvil adds.
|
Reviewed: no security, bug or performance issues found. The only real code is |
Codex Code Review
No security vulnerabilities found in the diff. |
Changes to gas cost
🧾 Summary (10% most significant diffs)
Full diff report 👇
|
MarcosNicolau
approved these changes
Oct 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
After #2308, the local devnet can't verify SP1 v6 aggregated proofs:
0x06530DD1…) only has the v5.0.0 route.This applies to both the anvil states and the ethereum-package preload in
network_params.yaml. Also, current anvil versions (1.7.1) can't load the committed anvil states: they fail parsing the stored transactions.How
This runs
make anvil_upgrade_proof_aggregator_sp1(the script added in #2308), after fixing it so it works with current anvil. It changes:0xd7CA37ff…F77d) and adds route0x4388a21cto the gateway.0x0061c444…3757(SP1) in both proof aggregation services, the real one (0xcbEAF3BD…) and the mock one (0xB0D4afd8…).network_params.yaml: the preloaded contracts are regenerated from the new alignedlayer state.contracts/deployments/31337.json: recordsV6_1_0_SP1_VERIFIER_GROTH16.Changes to the script:
localhost:8545.network_params.yamlpreload, skipping the hardfork system contracts anvil adds (e.g. the EIP-2935 one), since the ethereum-package genesis already includes them.The v5 route is kept, and nothing else changes:
network_params.yaml: only the preload changes. It differs from before only in the gateway route slot, the new verifier, the allowlist slot of both services and the CREATE2 deployer nonce.Verified
make anvil_startloads the new state with anvil 1.7.1. Route0x4388a21cpoints to the new verifier, which reportsVERSION() = v6.1.0andVERIFIER_HASH() = 0x4388a21c…. The new vk is allowed in both services.input-output-hk/plutus-groth16-wrapper). It verifies on Succinct's mainnet gateway and on the devnet gateway. A tampered copy reverts withProofInvalid.verifyAggregationSP1called from the aggregator address behaves as expected:InvalidVerifyingProgram.network_params.yamlpreload and booted it withanvil --init. It has the same route and allowlist, and the real v6.1.0 proof verifies.sp1_fibonacci_6_1_0.failed, applied.verifyAggregationSP1succeeded in a blob tx, with proof selector0x4388a21cand vk0x0061c444….AggregatedProofVerified, andisMerkleRootVerifiedreturnedtrue.verified.make verify_aggregated_proof_sp1found the proof in the aggregated proof.sp1_chunk_aggregator_vk_hash(0x0061c444…).How to test (ethereum-package devnet)
These steps were run on macOS on Apple Silicon. They should work on Linux too.
0. Prerequisites
cast(foundry),kurtosis,protocandgo, e.g.brew install kurtosis-tech/tap/kurtosis-cli protobuf go.1. Patch the gnark library (one-time, only needed for native Groth16)
sp1-sdk6.9.0'snative-gnarkfeature doesn't build anymore. It depends ongithub.com/consensys/gnark-ignition-verifier, which was removed from GitHub and the Go proxy. That code is only used to set up the PLONK circuit, so for local tests we stub it in a local copy:2. Build the aggregator
Build it before starting Kurtosis, so the two don't compete for Docker memory. The SP1 programs are built in Docker during this step.
3. Start the devnet
make ethereum_package_start cast block-number --rpc-url http://localhost:8545 # wait until it is > 0 (~2 min genesis delay)4. Gateway and payments poller (one terminal each)
make agg_mode_gateway_start_ethereum_package # Postgres + migrations + gateway make agg_mode_payments_poller_start_ethereum_package5. Pay and submit an SP1 v6 proof
6. Run the aggregator
Run the binary directly.
make proof_aggregator_start_ethereum_packagecan rebuild it withoutnative-gnark, which falls back to the Docker Groth16 image.Expected logs, in order:
Merkle root verification successful: roots matchProof sent and verified, tx hash ...Process finished successfullyThe first run downloads the v6.1.0 Groth16 circuit files (6.2 GB) to
~/.sp1/circuits. Peak memory was about 12 GB.7. Verify the proof inclusion like a user
8. Tear down
On a Linux x86 machine with enough RAM, steps 1 and 2 can probably be skipped by running
AGGREGATOR=sp1 make proof_aggregator_start_ethereum_package, which uses the Docker Groth16 image. That path was not tested. To test on anvil instead, usemake anvil_startwith the non-ethereum_packagetargets; there is no beacon node there, so step 7's inclusion check doesn't apply.🤖 Generated with Claude Code