Skip to content

feat: add v6.0.0-rc.1 verifier contracts#65

Closed
fakedev9999 wants to merge 7 commits intomainfrom
fakedev9999/v6-rc1-contracts
Closed

feat: add v6.0.0-rc.1 verifier contracts#65
fakedev9999 wants to merge 7 commits intomainfrom
fakedev9999/v6-rc1-contracts

Conversation

@fakedev9999
Copy link
Member

Summary

  • Update sp1-sdk dependency from private sp1-wip.git (branch multilinear_v6) to the public sp1 repo (v6.0.0-rc.1 tag)
  • Regenerate Plonk and Groth16 verifier contract artifacts for v6.0.0-rc.1
  • Fix artifacts.rs for rc.1 API change (try_install_circuit_artifacts now returns Result<PathBuf>)

Fixes the WrongVerifierSelector(0xbb1a6f29, 0x433cef0e) revert on submit_agg_proofs — the prover's v6.0.0-rc.1 SDK produces proofs with selector 0xbb1a6f29, but the deployed v6.0.0-beta.1 contracts expect 0x433cef0e.

New VERIFIER_HASH values

Type VERIFIER_HASH Selector
Plonk 0xbb1a6f29... 0xbb1a6f29
Groth16 0xf740f971... 0xf740f971

Deployment steps (after merge)

  1. Deploy new SP1VerifierPlonk (rc.1) to target chain(s)
  2. Call gateway.addRoute(newVerifierAddress) to register selector 0xbb1a6f29
  3. Optionally freeze old beta.1 route (0x433cef0e)

Test plan

  • Verify generated SP1VerifierPlonk.sol has VERIFIER_HASH prefix 0xbb1a6f29
  • Verify generated SP1VerifierGroth16.sol has correct VERIFIER_HASH
  • Verify deployment scripts have correct import paths and KEY constants
  • Deploy to target chain and confirm submit_agg_proofs no longer reverts

Yuwen Zhang and others added 7 commits January 14, 2026 12:22
…ration (#61)

Replace unconditional gateway.addRoute() call with env-var-controlled
conditional. This allows the same script to work for both:
- Multisig deployments (default): REGISTER_ROUTE unset/false, route added via Safe UI
- Direct deployments: REGISTER_ROUTE=true, route added during script execution

The gateway.addRoute() function has onlyOwner modifier, so when the gateway
owner is a multisig and the deployer is an EOA, the call would revert.
This change prevents deployment failures without requiring code modifications.
* feat: add Safe Transaction Builder JSON generator

Adds a Node.js script to generate Safe Transaction Builder JSON files
for registering verifier routes via multisig. This eliminates manual
copy/paste errors when executing Phase 2 (multisig) deployments.

Usage:
  node script/utils/generate-safe-batch.js --chain=all --version=v6.0.0-beta.1

Features:
- Generates JSON files compatible with Safe UI Transaction Builder
- Reads gateway addresses and verifier addresses from deployment files
- Supports all 5 mainnet chains (Ethereum, Optimism, Arbitrum, Base, Scroll)
- Handles version string conversion (v6.0.0-beta.1 -> V6_0_0_BETA_1)
- Encodes addRoute(address) calldata with correct function selector
- Includes ABI metadata for transaction decoding in Safe UI

* refactor: code quality improvements for generate-safe-batch.js

- Compact: single regex in versionToKey, reuse for filename generation
- Concise: inline object literals, simplified arg parsing
- Clean: condensed JSDoc to single-line comments, consistent error indentation
- Capable: added chain ID validation, JSON parse error handling, verifier loop

* chore: remove slop from generate-safe-batch.js (200→102 lines)

* fix: read available chains from deployments directory
Update sp1-sdk dependency from sp1-wip multilinear_v6 to the public
sp1 v6.0.0-rc.1 release tag. Regenerate verifier contract artifacts
to fix the WrongVerifierSelector mismatch where proofs embed selector
0xbb1a6f29 but the deployed beta.1 contracts expected 0x433cef0e.

New VERIFIER_HASH values:
- Plonk:   0xbb1a6f2930e94bfe8b35e794faf43133214534a17d2ad8e51358cad437b3c317
- Groth16: 0xf740f971b653af36c811da1611fd464ce4cc12eec5f604431a5afbba411249cd
The SP1 v6.0.0-rc.1 SDK artifact generation outputs VK_ROOT as 33
bytes (66 hex chars), which doesn't fit in Solidity's bytes32. Strip
the extra leading 0x00 byte to fix compilation.
inputs[3] = vkRoot;
inputs[4] = nonce;

if (exitCode != 0) {
Copy link
Contributor

Choose a reason for hiding this comment

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

matt says to move these checks before declaring the uint256[5] memory inputs;

Copy link
Member

Choose a reason for hiding this comment

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

yep it's strictly better

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll move both the exit code, vkey validation checks before inputs array allocation in #70

Copy link
Member Author

Choose a reason for hiding this comment

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

Also updated sp1 side to avoid regression in the future succinctlabs/sp1@61330b6

@fakedev9999
Copy link
Member Author

Superseded by #70.

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.

3 participants