Skip to content

Conversation

@curryxbo
Copy link
Contributor

@curryxbo curryxbo commented Feb 10, 2026

Summary by CodeRabbit

  • Chores
    • Added handling for an additional batch transaction variant so batch payloads that include proofs are recognized and processed.
    • Newly supported batch fields (version, parent headers, last block number, message counts and state/withdrawal roots) are extracted and populated into rollup batch records.
    • Returns a clear error when payload unpacking fails to aid diagnostics.

@curryxbo curryxbo self-assigned this Feb 10, 2026
@curryxbo curryxbo added the enhancement New feature or request label Feb 10, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 10, 2026

📝 Walkthrough

Walkthrough

Adds handling for a new commitBatchWithProof transaction path in UnPackData. When the input matches the commitBatchWithProof selector, the code unpacks arguments via the rollup ABI, extracts batch payload fields, constructs an RPCRollupBatch with converted hash fields, and returns unpacking errors when they occur.

Changes

Cohort / File(s) Summary
New Transaction Type Handler
node/derivation/derivation.go
Added handling for commitBatchWithProof in UnPackData. Unpacks rollup ABI args, extracts batch payload (Version, ParentBatchHeader, LastBlockNumber, NumL1Messages, PrevStateRoot, PostStateRoot, WithdrawalRoot), converts roots to hashes, and constructs an RPCRollupBatch.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 A new proofed batch hops into view,
Fields unpacked, roots turned true,
Bits stitched neat in a tidy stack,
Hashes snug on the rabbit track,
I nibble bugs and guard the queue.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'support derive commitBatchWithProof event' clearly and concisely describes the main change: adding support for deriving the commitBatchWithProof event, which is exactly what the changeset implements by handling the new commitBatchWithProof transaction path in UnPackData.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch derive_commitBatchWithProof

No actionable comments were generated in the recent review. 🎉

🧹 Recent nitpick comments
node/derivation/derivation.go (1)

448-493: Consider extracting the shared unpacking logic to reduce duplication.

The commitBatchWithProof branch (lines 471–493) is an exact copy of the commitBatch branch (lines 448–470) — same struct, same field mapping. With four branches now in UnPackData, a helper that accepts the unpacked args and constructs the RPCRollupBatch would reduce duplication. Not urgent since each branch may diverge in the future, but worth considering.


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 and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In `@node/derivation/derivation.go`:
- Line 474: The error message in the return inside commitBatchWithProof is
inconsistent: change the string "commitBatchWithProof submitBatches Unpack
error:%v" to a consistent prefix such as "commitBatchWithProof Unpack error:%v"
so the log reflects the correct function context; update the return in
commitBatchWithProof that currently wraps err to use the revised message.
- Around line 471-493: The error string for the ABI unpack failure in the branch
that detects commitBatchWithProof is incorrect; update the fmt.Errorf call
inside the commitBatchWithProof branch (where you call
rollupABI.Methods["commitBatchWithProof"].Inputs.Unpack) to return
"commitBatchWithProof Unpack error:%v" instead of "commitBatchWithProof
submitBatches Unpack error:%v" so the message matches the method name and other
branches.
🧹 Nitpick comments (1)
node/derivation/derivation.go (1)

471-493: Consider extracting the duplicated batch-unpacking logic into a helper.

Lines 471–493 are an exact copy of lines 448–470 (the commitBatch rollupABI branch). All four branches in UnPackData share the same pattern: unpack → type-assert → build RPCRollupBatch. A small helper (e.g., unpackBatchArgs(method *abi.Method, data []byte) (geth.RPCRollupBatch, error)) parameterized by the ABI method would eliminate this repetition and reduce the risk of future copy-paste drift.

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@curryxbo curryxbo requested a review from a team as a code owner February 10, 2026 10:25
@curryxbo curryxbo requested review from panos-xyz and removed request for a team February 10, 2026 10:25
@curryxbo curryxbo merged commit 7efc270 into main Feb 11, 2026
13 checks passed
@curryxbo curryxbo deleted the derive_commitBatchWithProof branch February 11, 2026 08:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants