Skip to content

Commit 280bfb9

Browse files
allen.wuclaude
andcommitted
feat: add Jade fork check to AssembleL2BlockV2
Add the same Jade fork safety check that V1 has, preventing block production with wrong storage format (MPT vs zkTrie) at fork boundary. Co-Authored-By: Claude Opus 4.6 <[email protected]>
1 parent e442d2c commit 280bfb9

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

eth/catalyst/l2_api.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,11 @@ func (api *l2ConsensusAPI) AssembleL2BlockV2(parentHash common.Hash, timestamp *
427427
ts = time.Unix(int64(*timestamp), 0)
428428
}
429429

430+
// Jade fork check: prevent building blocks with wrong storage format (MPT vs zkTrie)
431+
if api.eth.BlockChain().Config().IsJadeFork(uint64(ts.Unix())) == api.eth.BlockChain().Config().Morph.UseZktrie {
432+
return nil, fmt.Errorf("cannot assemble block for fork, useZKtrie: %v, please switch geth", api.eth.BlockChain().Config().Morph.UseZktrie)
433+
}
434+
430435
newBlockResult, err := api.eth.Miner().BuildBlock(parentHash, ts, transactions)
431436
if err != nil {
432437
return nil, err

0 commit comments

Comments
 (0)