Skip to content

[Pushers L02] Linea Pusher msg.value mismatch#79

Merged
luiz-lvj merged 1 commit intomainfrom
fix/pushers-L02
Feb 12, 2026
Merged

[Pushers L02] Linea Pusher msg.value mismatch#79
luiz-lvj merged 1 commit intomainfrom
fix/pushers-L02

Conversation

@luiz-lvj
Copy link
Collaborator

@luiz-lvj luiz-lvj commented Feb 11, 2026

Issue:
The LineaPusher.pushHashes function forwards the full msg.value to the Linea messenger while only decoding _fee from the transaction data. In Linea's L1 message service, the Linea bridge forwards msg.value - _fee to the destination contract. On L2, a postman or user calls claimMessage on the L2MessageService with the same _value and _calldata. Since LineaBuffer.receiveHashes is -payable (per the IBuffer interface), any call where msg.value > _fee creates a message that permanently reverts on claim. This burns the paid fees, leaves the block hashes unapplied, and contradicts documentation stating that msg.value must be "at least" the fee.

This PR validates msg.value == _fee in LineaPusher.pushHashes and reverting with IncorrectMsgValue on a mismatch.

Summary by CodeRabbit

Bug Fixes

  • Improved error handling for incorrect value submissions. Error messages now display expected versus actual amounts sent, providing clearer feedback when transactions fail due to value mismatches.

@luiz-lvj luiz-lvj requested a review from pepebndc February 11, 2026 19:57
@coderabbitai
Copy link

coderabbitai bot commented Feb 11, 2026

📝 Walkthrough

Walkthrough

This PR refines the LineaPusher contract's fee validation logic by extracting the fee into a local variable and adding explicit msg.value verification against the expected fee, with corresponding test updates to validate both underpayment and overpayment scenarios.

Changes

Cohort / File(s) Summary
Fee Validation Enhancement
src/contracts/block-hash-pusher/linea/LineaPusher.sol
Introduces a local fee variable extracted from l2Transaction._fee, adds explicit validation that msg.value == fee with custom error IncorrectMsgValue(fee, msg.value), and uses the local variable in the subsequent message service call.
Test Updates
test/block-hash-pusher/linea/LineaPusher.t.sol
Updates test expectations from generic ValueSentTooLow to explicit IncorrectMsgValue with parameter pairs; renames test function from testFuzz_pushHashes_reverts_if_value_too_low to testFuzz_pushHashes_reverts_if_value_is_incorrect; adds validation for both underpayment and overpayment cases; adjusts user balance in fuzzed test from 0.005 to 0.006 ether.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • broadcaster#59: Directly introduces the fee handling refinement in LineaPusher pushHashes that this PR builds upon.
  • broadcaster#73: Also modifies LineaPusher.sol's pushHashes function with validation enhancements.

Suggested reviewers

  • pepebndc
  • frangio

Poem

🐰 A fee check hops with care,
Msg.value matches with a pair,
No more guessing high or low,
Explicit errors help us know,
Precision in each pusher's stare! 🎯

🚥 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 directly and specifically identifies the main change: enforcing msg.value equality to the decoded fee in LineaPusher to prevent mismatches.
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 unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/pushers-L02

No actionable comments were generated in the recent review. 🎉


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.

@luiz-lvj luiz-lvj merged commit b21d9bc into main Feb 12, 2026
3 checks passed
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.

2 participants