feat: remove sequencer batch generation from consensus layer#35
feat: remove sequencer batch generation from consensus layer#35FletcherMan merged 3 commits intomainfrom
Conversation
Remove the Batcher interface and all related BLS/batch logic from the Tendermint consensus layer per SPEC-004. Deleted: - consensus/batch.go: entire BatchCache implementation - blssignatures/: entire package (BLS key gen, signing, file helpers) Key changes: - l2node: remove Batcher interface (6 methods), VerifySignature, BlsData, GetBLSDatas, ConsensusData.BatchHash; L2Node now only exposes RequestHeight/EncodeTxs/RequestBlockData/CheckBlockData/DeliverBlock - l2node/mock.go: sync mock to new interface - consensus/state.go: remove decideBatchPoint*, batchCache field, BLS accumulation/validation/self-sign paths, SetBLSPrivKey, blsPrivKey - consensus/replay.go: sync ExecBlockOnL2Node call (drop dead commit param) - consensus/wal_generator.go: remove BLS key loading - state/state.go: remove decideBatchPointFunc type and MakeBlock param - state/execution.go: remove decideBatchPoint param, commit-phase batch calls (CommitBatch/PackCurrentBlock), drop dead commit param from ExecBlockOnL2Node - blocksync/reactor.go: remove redundant batch-point validation block - types/params.go: remove Go-side BatchParams struct (proto field retained for wire compatibility) - node/node.go: remove blsPrivKey field, param, and DefaultNewNode loading - cmd/tendermint/commands/init.go: remove BLS key gen/load on init - config/config.go: remove BLSKey field, defaultBLSKeyName/Path constants, BLSKeyFile() method - test/e2e/node/main.go, rpc/test/helpers.go, consensus/wal_generator.go: remove BLS key loading and NewNode blsPrivKey param Wire-compatible fields retained (per spec §3.2.1): - types/block.go: Header.BatchHash, BlockID.BatchHash, Data.L2BatchHeader, Header.IsBatchPoint() - types/vote.go: Vote.BLSSignature, ValidateBasic length constraints - types/canonical.go: BlockID.BatchHash in canonical bytes - proto/tendermint/types/types.proto + generated .pb.go: all proto fields Note: three test fixtures (consensus/TestConsMsgsVectors, blocksync/TestBlockchainMessageVectors, evidence/TestEvidenceVectors) fail due to a pre-existing golden-byte mismatch caused by BlockID.BatchHash shifting PartSetHeader field number from 2 to 3; unrelated to this change. Also fixes a pre-existing compile gap in rpc/test/helpers.go and test/e2e/node/main.go where NewNode callers were missing the sequencerVerifier/sequencerSigner params added in a prior PR. Made-with: Cursor
L2Node.DeliverBlock returned *tmproto.BatchParams as its first value, but that value is forwarded through ExecBlockOnL2Node -> ApplyBlock -> GetConsensusParamsUpdate -> ConsensusParams.Update / FromProto, where the Batch field is explicitly ignored (see types/params.go comments). The full Go-level path is dead. This commit removes the unused return at every Go-level layer: - l2node.L2Node.DeliverBlock interface signature (drop first return) - l2node.MockL2Node.DeliverBlock mock impl - state.ExecBlockOnL2Node return type - state.BlockExecutor.ApplyBlock call site - state.BlockExecutor.GetConsensusParamsUpdate parameter - consensus/replay.go ExecBlockOnL2Node call site Wire format is unchanged: tmproto.ConsensusParams.Batch and tmproto.BatchParams proto fields stay for historical state compatibility, and the "intentionally ignored" comments in ConsensusParams.Update and ConsensusParamsFromProto are preserved. This is a coordinated cross-repo break with morph/node Executor.DeliverBlock implementation, on top of the existing ConsensusData.BatchHash field removal in this PR (no extra coordination cost). Per spec-004 tech-design-tendermint.md task #5b. Made-with: Cursor
Code reviewFound 1 issue:
Lines 208–210 of
If any validator upgrades (loses BLS keys) before the sequencer does, the sequencer will still propose blocks with The PR body's upgrade note ("sequencer must upgrade first, wait for last batch to finalize on L1, then upgrade remaining nodes") is a manual mitigation, but the code provides no enforcement. Consider removing or relaxing lines 208–210 so that an empty Lines 207 to 212 in f48e285 🤖 Generated with Claude Code - If this code review was useful, please react with 👍. Otherwise, react with 👎. |
Code review (additional findings)Found 2 more issues:
Recommend rejecting non-empty Lines 1771 to 1777 in f48e285 Lines 1229 to 1234 in f48e285 Lines 618 to 622 in f48e285
The PR body states that
Recommend either emitting Lines 246 to 264 in f48e285 🤖 Generated with Claude Code - If this code review was useful, please react with 👍. Otherwise, react with 👎. |
Summary
Batcherinterface (6 methods),VerifySignature,BlsData,GetBLSDatas,ConsensusData.BatchHashfroml2node;L2Nodenow only exposes block execution methodsconsensus/batch.go(entireBatchCacheimplementation),blssignatures/package, and all BLS private key loading/passing chaindecideBatchPoint*logic, batch-phase commit calls (CommitBatch/PackCurrentBlock), BLS accumulation/validation/self-sign paths fromconsensus/state.goandstate/execution.goblocksync/reactor.goBatchParamsstruct fromtypes/params.go(proto field retained for wire compatibility)config/config.goandcmd/tendermint/commands/init.goWire Compatibility
The following fields are retained per historical block sync requirements:
types/block.go:Header.BatchHash,BlockID.BatchHash,Data.L2BatchHeader,Header.IsBatchPoint()types/vote.go:Vote.BLSSignature,ValidateBasiclength constraintstypes/canonical.go:BlockID.BatchHashin canonical bytesproto/tendermint/types/types.proto+ generated.pb.goTest Notes
Three pre-existing test fixture failures are not introduced by this PR:
consensus/TestConsMsgsVectorsblocksync/TestBlockchainMessageVectorsevidence/TestEvidenceVectorsThese fail due to a golden-byte mismatch caused by
BlockID.BatchHashshiftingPartSetHeaderfield number from 2 to 3 in proto encoding — a pre-existing issue confirmed by running the same tests against the base commit.Upgrade Notes
Mixed-version deployment (some nodes upgraded, some not) carries a liveness risk if a batch-point block is proposed during the window. Recommended upgrade order: upgrade the sequencer node first to stop producing blocks with
BatchHash, wait for the last batch to finalize on L1, then upgrade remaining nodes.Scope Note
Also fixes a pre-existing compile gap in
rpc/test/helpers.goandtest/e2e/node/main.gowherenode.NewNode(...)callers were missing thesequencerVerifier/sequencerSignerparams added in a prior PR (passingnil, nil).Related
v0.3.5-alpha.1v0.3.5Made with Cursor