From 37103b52736259a4672821a6c6737e8ab94313cd Mon Sep 17 00:00:00 2001 From: corey Date: Tue, 10 Feb 2026 18:17:19 +0800 Subject: [PATCH 1/2] support derive commitBatchWithProof event --- node/derivation/derivation.go | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/node/derivation/derivation.go b/node/derivation/derivation.go index 5eccd2e9c..3071f3c7f 100644 --- a/node/derivation/derivation.go +++ b/node/derivation/derivation.go @@ -468,6 +468,29 @@ func (d *Derivation) UnPackData(data []byte) (geth.RPCRollupBatch, error) { PostStateRoot: common.BytesToHash(rollupBatchData.PostStateRoot[:]), WithdrawRoot: common.BytesToHash(rollupBatchData.WithdrawalRoot[:]), } + } else if bytes.Equal(d.rollupABI.Methods["commitBatchWithProof"].ID, data[:4]) { + args, err := d.rollupABI.Methods["commitBatchWithProof"].Inputs.Unpack(data[4:]) + if err != nil { + return batch, fmt.Errorf("commitBatchWithProof submitBatches Unpack error:%v", err) + } + rollupBatchData := args[0].(struct { + Version uint8 "json:\"version\"" + ParentBatchHeader []uint8 "json:\"parentBatchHeader\"" + LastBlockNumber uint64 "json:\"lastBlockNumber\"" + NumL1Messages uint16 "json:\"numL1Messages\"" + PrevStateRoot [32]uint8 "json:\"prevStateRoot\"" + PostStateRoot [32]uint8 "json:\"postStateRoot\"" + WithdrawalRoot [32]uint8 "json:\"withdrawalRoot\"" + }) + batch = geth.RPCRollupBatch{ + Version: uint(rollupBatchData.Version), + ParentBatchHeader: rollupBatchData.ParentBatchHeader, + LastBlockNumber: rollupBatchData.LastBlockNumber, + NumL1Messages: rollupBatchData.NumL1Messages, + PrevStateRoot: common.BytesToHash(rollupBatchData.PrevStateRoot[:]), + PostStateRoot: common.BytesToHash(rollupBatchData.PostStateRoot[:]), + WithdrawRoot: common.BytesToHash(rollupBatchData.WithdrawalRoot[:]), + } } else { return batch, types.ErrNotCommitBatchTx } From 6ccaa048863a7ac6dbd03e0719aefb7d1119006d Mon Sep 17 00:00:00 2001 From: corey Date: Tue, 10 Feb 2026 18:25:22 +0800 Subject: [PATCH 2/2] Apply suggestions from code review Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- node/derivation/derivation.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/node/derivation/derivation.go b/node/derivation/derivation.go index 3071f3c7f..450cc5d40 100644 --- a/node/derivation/derivation.go +++ b/node/derivation/derivation.go @@ -471,7 +471,7 @@ func (d *Derivation) UnPackData(data []byte) (geth.RPCRollupBatch, error) { } else if bytes.Equal(d.rollupABI.Methods["commitBatchWithProof"].ID, data[:4]) { args, err := d.rollupABI.Methods["commitBatchWithProof"].Inputs.Unpack(data[4:]) if err != nil { - return batch, fmt.Errorf("commitBatchWithProof submitBatches Unpack error:%v", err) + return batch, fmt.Errorf("commitBatchWithProof Unpack error:%v", err) } rollupBatchData := args[0].(struct { Version uint8 "json:\"version\""