Skip to content

feat: complete post-centralization cleanup - #1037

Open
SegueII wants to merge 38 commits into
mainfrom
centralization-cleanup
Open

feat: complete post-centralization cleanup#1037
SegueII wants to merge 38 commits into
mainfrom
centralization-cleanup

Conversation

@SegueII

@SegueII SegueII commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Summary

  • introduce an independent, upgradeable, staked Submitter role for L1 batch submission, exit, withdrawal, and slashing
  • update Rollup authorization and accountability while removing current bitmap/BLS/BatchSignatureInput inputs
  • keep the batch-header layout and public-input preimage stable, but write zero in the former sequencer-set field and remove the prover's dedicated slot-101 witness constraint
  • preserve historical ABI/selector decoding and update only the submission methods already handled by each downstream consumer
  • remove tx-submitter rotation and dummy-signature dependencies while preserving its stored-hash-driven commitBatch/commitState flow, journal, pending rebuild, and blob behavior
  • wire Submitter deployment, bindings, explicit batch timing configuration, challenge/shadow/gas-oracle compatibility, and devnet runtime configuration

Contract and protocol changes

Submitter

  • owner-managed registration/removal with submitter self-staking
  • isActive = registered && !withdrawing && stake >= minimumStake
  • withdrawal and owner removal immediately revoke registration; staked exits snapshot lastCommittedBatchIndex
  • claims unlock when lastFinalizedBatchIndex reaches that address's snapshot, independent of later batches from other submitters
  • stake remains slashable until claimed; claim and slash clear the exit snapshot

Rollup

  • reuse the legacy staking-address slot for submitterContract and set it atomically through ProxyAdmin.upgradeAndCall(initialize4)
  • reject initialization unless the Rollup is drained, has no active challenge, and has no revert request
  • authorize submitter-only paths with Submitter.isActive(msg.sender)
  • store the actual submitter address in BatchData; permissionless commitBatchWithProof stores address(0)
  • read challenge deposit/slashing economics from Submitter and slash the recorded address
  • expose the new selectors:
    • commitBatch(BatchDataInput)0x41f756da
    • commitState(BatchDataInput)0x67caa37a
    • commitBatchWithProof(BatchDataInput,bytes,bytes)0x1544ba3a

Header and prover

  • preserve the header length and offsets; [185,217) is now bytes32(0) for post-upgrade submissions
  • preserve public-input preimage ordering and use zero in the corresponding 32-byte position
  • remove the dedicated Sequencer slot-101 read, witness prefetch, and equality constraint
  • retain L2 post-state-root verification and all existing data/blob/root checks
  • rebuild the verifier ELF and synchronize the program vkey used by deployment configuration

Compatibility boundaries

This PR deliberately preserves the existing batch state machine:

  • commitBatch still requires the next index to have no stored blob hash and cannot replace prior blob content
  • revertBatch still preserves the stored blob hash; tx-submitter uses blobless commitState for state resubmission
  • commitBatchWithProof retains its permissionless threshold, stored-hash/blob selection, proof checks, and immediate finality
  • V0/V1 zero-versioned-hash and V2 blob rules remain unchanged
  • tx-submitter keeps its journal schema, data directory, pending/reorg/replacement behavior, and blob sidecar rules
  • node/core, validator sourcing, syncer lifecycle, PBFT/V1 verification, L1Sequencer, L2 contracts, and genesis predeploy definitions are not changed
  • derivation, challenge, shadow-prove, and gas-oracle add new selectors only for methods they already process; they do not add commitState recovery
  • no responsibility counter, fresh-blob replacement, canonical blob-source resolver, static validator cutover, signer failover, or new persistence model is introduced

Validation

  • GitHub checks pass for Contracts, Deployer, Gas-oracle, Node, Prover, Tx-submitter, and CodeQL
  • Rollup and Submitter contract tests pass, including storage-layout and exit-snapshot coverage
  • ABI archive/bindings verification and targeted selector/header compatibility tests pass
  • tx-submitter tests and targeted node, prover client/server, challenge, gas-oracle, and devnet checks pass
  • node/core has no functional diff from the implementation baseline
  • reproduce the SP1 v6.2.0 ELF in Docker and generate matching main/shadow PLONK fixtures
  • complete environment-dependent shadow/fork/staging tests and verify the first post-upgrade proof

Release blockers and operator actions

This PR makes the repository ready for the planned upgrade; merging it does not execute or authorize production cutover.

  • snapshot batchBlockInterval and batchTimeout from the same stable L2 block, record its number/hash, and recheck before disabling Gov refresh
  • provide and verify working/backup submitter addresses, keys, registration, stake, and identical runtime values
  • drain Rollup, clear challenge/revert state, finish old-ABI journal entries, and verify every instance has no pre-upgrade sealed cache entry above the cutover finalized index
  • decide how to handle the final pre-upgrade shadow batch before switching ShadowRollup to the new-vkey verifier
  • rehearse Submitter deployment, atomic Rollup upgradeAndCall, verifier switches, and first post-upgrade commit/proof/finalize on a production-state fork or staging environment
  • explicitly accept the existing unsupported-commitState boundary for derivation/challenge/shadow/gas-oracle if the cutover next index already has a stored hash
  • resolve the fresh-network L2Staking.OTHER_STAKING legacy-address dependency separately; do not substitute Submitter or a dummy address
  • assess L2 data retention before any legacy L1Staking withdrawal/removal operation

Closes #999

Made with Cursor

@SegueII
SegueII requested a review from a team as a code owner August 11, 2026 18:23
@SegueII
SegueII requested review from twcctop and removed request for a team August 11, 2026 18:23

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Claude Code Review

Claude Code Review is paused for this repository. To reconnect it, an admin of this repository's GitHub organization (or the account owner, for personal repositories) who can also manage your Claude organization's Code Review settings needs to re-link GitHub in Code Review settings. This is a one-time step.

Tip: disable this comment in your organization's Code Review settings.

@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Too many files!

This PR contains 125 files, which is 25 over the limit of 100.

To get a review, reduce the PR to 100 files or fewer by splitting it into smaller PRs or changing its base branch.

Upgrade to a paid plan to raise the limit.

This review couldn't start because sufficient usage credits or metered capacity aren't available. Add credits or update usage-based reviews in the billing tab, then retry.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 9822969e-c07f-4144-a810-cabe7f729d6f

📥 Commits

Reviewing files that changed from the base of the PR and between 3d21e1f and 91f2672.

📒 Files selected for processing (125)
  • bindings/Makefile
  • bindings/bin/l1staking_deployed.hex
  • bindings/bin/rollup_deployed.hex
  • bindings/bin/submitter_deployed.hex
  • bindings/bindings/centralization_cleanup_test.go
  • bindings/bindings/l1staking.go
  • bindings/bindings/l1staking_more.go
  • bindings/bindings/rollup.go
  • bindings/bindings/rollup_more.go
  • bindings/bindings/submitter.go
  • bindings/bindings/submitter_more.go
  • common/batch/batch_cache.go
  • common/batch/batch_cache_genesis_header_test.go
  • common/batch/batch_cache_test.go
  • common/batch/batch_query.go
  • common/batch/batch_query_test.go
  • common/batch/batch_restart_test.go
  • common/batch/batch_storage.go
  • common/batch/batch_storage_test.go
  • common/batch/batch_transition_test.go
  • common/batch/commit_test.go
  • common/batch/interfaces.go
  • common/batch/l2_gov.go
  • common/batch/selector_boundary_test.go
  • contracts/abi/archive/README.md
  • contracts/abi/archive/legacy-l1-staking/L1Staking.json
  • contracts/abi/archive/manifest.json
  • contracts/abi/archive/pre-submitter/Rollup.json
  • contracts/contracts/Staking.md
  • contracts/contracts/l1/rollup/BLS.sol
  • contracts/contracts/l1/rollup/IRollup.sol
  • contracts/contracts/l1/rollup/ISubmitter.sol
  • contracts/contracts/l1/rollup/Rollup.sol
  • contracts/contracts/l1/rollup/Submitter.sol
  • contracts/contracts/l1/staking/IL1Staking.sol
  • contracts/contracts/l1/staking/L1Staking.sol
  • contracts/contracts/test/L1Staking.t.sol
  • contracts/contracts/test/Rollup.t.sol
  • contracts/contracts/test/Submitter.t.sol
  • contracts/contracts/test/base/L1MessageBase.t.sol
  • contracts/deploy/013-DeployProxys.ts
  • contracts/deploy/014-DeployImpls.ts
  • contracts/deploy/015-SubmitterInit.ts
  • contracts/deploy/016-RollupInit.ts
  • contracts/deploy/018-StakingInit.ts
  • contracts/deploy/019-AdminTransfer.ts
  • contracts/deploy/020-ContractInit.ts
  • contracts/deploy/021-StakingRegister.ts
  • contracts/deploy/021-SubmitterRegister.ts
  • contracts/deploy/index.ts
  • contracts/hardhat.config.ts
  • contracts/integration-test/upgrade_rollup_proxy.spec.ts
  • contracts/package.json
  • contracts/scripts/clean-generated-abi.js
  • contracts/scripts/verify-abi-archive.js
  • contracts/src/deploy-config/holesky.ts
  • contracts/src/deploy-config/hoodi.ts
  • contracts/src/deploy-config/l1.ts
  • contracts/src/deploy-config/qanetl1.ts
  • contracts/src/deploy-config/sepolia.ts
  • contracts/src/deploy-config/testnetl1.ts
  • contracts/src/types.ts
  • contracts/storage-layout/archive/Rollup.pre-submitter.json
  • contracts/tasks/README.md
  • contracts/tasks/deploy.ts
  • contracts/tasks/proxy_upgrade.ts
  • contracts/tasks/staking_upgrade.ts
  • gas-oracle/app/src/abi/Rollup.json
  • node/derivation/calldata_fixture_test.go
  • node/derivation/derivation.go
  • node/derivation/derivation_test.go
  • node/derivation/selector_cursor_test.go
  • node/derivation/testdata/rollup_calldata_fixtures.json
  • node/types/abi/pre_submitter_rollup.json
  • node/types/batch.go
  • ops/devnet-morph/devnet/__init__.py
  • ops/devnet-morph/tests/test_devnet_config.py
  • ops/docker/.env
  • ops/docker/docker-compose-devnet.yml
  • prover/bin/challenge/src/abi/Rollup.json
  • prover/bin/challenge/src/handler.rs
  • prover/bin/client/elf/verifier-client
  • prover/bin/server/src/queue.rs
  • prover/bin/shadow-prove/abi/Rollup.json
  • prover/bin/shadow-prove/abi/ShadowRollup.json
  • prover/bin/shadow-prove/contracts/README.md
  • prover/bin/shadow-prove/contracts/bytecode/ShadowRollup.json
  • prover/bin/shadow-prove/contracts/src/ShadowRollup.sol
  • prover/bin/shadow-prove/src/execute.rs
  • prover/bin/shadow-prove/src/shadow_rollup.rs
  • prover/contracts/README.md
  • prover/crates/executor/client/src/lib.rs
  • prover/crates/executor/client/src/types/batch.rs
  • prover/crates/executor/client/src/verifier/evm_verifier.rs
  • prover/crates/executor/host/src/execute.rs
  • prover/crates/mpt/src/mpt.rs
  • prover/crates/primitives/src/predeployed.rs
  • tx-submitter/README.md
  • tx-submitter/entry.go
  • tx-submitter/event/indexer.go
  • tx-submitter/event/storage.go
  • tx-submitter/event/storage_test.go
  • tx-submitter/flags/flags.go
  • tx-submitter/iface/client.go
  • tx-submitter/iface/rollup.go
  • tx-submitter/metrics/metrics.go
  • tx-submitter/mock/event_storage.go
  • tx-submitter/mock/l1staking.go
  • tx-submitter/mock/l2client.go
  • tx-submitter/mock/rollup.go
  • tx-submitter/mock/submitter.go
  • tx-submitter/params/leveldb_keys.go
  • tx-submitter/services/batch_fecher.go
  • tx-submitter/services/batch_fetcher_test.go
  • tx-submitter/services/rollup.go
  • tx-submitter/services/rollup_commit_rebuild_test.go
  • tx-submitter/services/rollup_handle_test.go
  • tx-submitter/services/rollup_test.go
  • tx-submitter/services/rotator.go
  • tx-submitter/types/batch_cache.go
  • tx-submitter/types/batch_cache_test.go
  • tx-submitter/types/l2Caller.go
  • tx-submitter/utils/config.go
  • tx-submitter/utils/config_test.go
  • tx-submitter/utils/utils.go

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Warning

Billing warning: we have not been able to collect payment for this subscription for more than 72 hours. Please update the payment method or pay any pending invoices in Billing to avoid service interruption.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Claude Code Review

Claude Code Review is paused for this repository. To reconnect it, an admin of this repository's GitHub organization (or the account owner, for personal repositories) who can also manage your Claude organization's Code Review settings needs to re-link GitHub in Code Review settings. This is a one-time step.

Tip: disable this comment in your organization's Code Review settings.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Claude Code Review

Claude Code Review is paused for this repository. To reconnect it, an admin of this repository's GitHub organization (or the account owner, for personal repositories) who can also manage your Claude organization's Code Review settings needs to re-link GitHub in Code Review settings. This is a one-time step.

Tip: disable this comment in your organization's Code Review settings.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Claude Code Review

Claude Code Review is paused for this repository. To reconnect it, an admin of this repository's GitHub organization (or the account owner, for personal repositories) who can also manage your Claude organization's Code Review settings needs to re-link GitHub in Code Review settings. This is a one-time step.

Tip: disable this comment in your organization's Code Review settings.

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.

Complete post-centralization contract and service cleanup

3 participants