Skip to content

fix(tx-submitter): align CancelTx blob sidecar version with ReSubmitTx - #1055

Open
crazywriter1 wants to merge 2 commits into
morph-l2:mainfrom
crazywriter1:fix/cancel-tx-blob-sidecar-v1
Open

fix(tx-submitter): align CancelTx blob sidecar version with ReSubmitTx#1055
crazywriter1 wants to merge 2 commits into
morph-l2:mainfrom
crazywriter1:fix/cancel-tx-blob-sidecar-v1

Conversation

@crazywriter1

@crazywriter1 crazywriter1 commented Aug 31, 2026

Copy link
Copy Markdown

Summary

CancelTx built blob sidecars with v0 KZG proofs only (ComputeBlobProof), while ReSubmitTx and createBlobTx use DetermineBlobVersion and v1 cell proofs after the Osaka fork. Cancelling a blob tx on post-Osaka L1 could therefore produce an invalid sidecar.

This PR aligns CancelTx with the same blob-version selection path.

Changes

  • Extract buildCancelBlobSidecar(head, chainID) helper shared by CancelTx
  • Use blob.DetermineBlobVersion to choose v0 (KZG proof) vs v1 (cell proofs via MakeCellProof)
  • Pass L1 head from GetGasTipAndCap() into sidecar construction
  • Guard against nil blobFeeCap when cancelling non-blob txs in the same code path
  • Add TestBuildCancelBlobSidecarVersion with explicit pre-Osaka and Osaka headers (isolated unit test, no mock L1 dependency)

Testing

cd tx-submitter
go test ./services/... -run 'TestBuildCancelBlobSidecarVersion|TestCancelTx' -count=1 -v 

All tests pass locally.

Summary by CodeRabbit

  • Bug Fixes
    • Improved cancellation of blob transactions across supported protocol versions.
    • Ensured cancellations consistently include the required blob sidecar, proofs, and versioned hash.
    • Improved handling when blob fee data is unavailable by safely applying a zero value.
    • Added compatibility for both pre-Osaka and Osaka-era blob transaction formats.

Extract buildCancelBlobSidecar helper using DetermineBlobVersion + cell proofs
for Osaka (v1). Add nil blobFeeCap guard. Test v0/v1 in isolated unit test
instead of fragile mock-L1 integration block.
@crazywriter1
crazywriter1 requested a review from a team as a code owner August 31, 2026 14:38
@crazywriter1
crazywriter1 requested review from dylanCai9 and removed request for a team August 31, 2026 14:38
@coderabbitai

coderabbitai Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 2769bdeb-2cc3-4b7c-8c25-877edfd6d81b

📥 Commits

Reviewing files that changed from the base of the PR and between 5edbc69 and ece8b79.

📒 Files selected for processing (2)
  • tx-submitter/services/rollup.go
  • tx-submitter/services/rollup_test.go

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

Blob cancellation now builds an empty sidecar for the active blob version. CancelTx retains the L1 header, normalizes a nil blob fee cap, and uses the generated proof and versioned hash. Tests cover pre-Osaka and Osaka sidecar versions.

Changes

Blob cancellation

Layer / File(s) Summary
Version-aware sidecar construction
tx-submitter/services/rollup.go, tx-submitter/services/rollup_test.go
buildCancelBlobSidecar selects sidecar version 0 or 1 from the L1 header, generates proofs and a versioned hash, and reports errors. Tests cover both versions.
Cancellation transaction integration
tx-submitter/services/rollup.go, tx-submitter/services/rollup_test.go
CancelTx retains the L1 header, converts a nil blob fee cap to zero, and uses the shared sidecar builder. Tests assert that the cancellation transaction has a sidecar.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: ⚪ Minimal · up to d3426

The change aligns cancellation sidecars with the active protocol version while preserving the existing signing and submission flow. No actionable merge-blocking risk remains after normal checks and review.

Suggested reviewers: dylancai9, twcctop, segueii

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely identifies the main change: aligning CancelTx blob sidecar version handling with ReSubmitTx.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@crazywriter1

Copy link
Copy Markdown
Author

@coderabbitai re-review

@coderabbitai

coderabbitai Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

@crazywriter1 I will re-review pull request #1055.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

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.

1 participant