Check the proposer payment on both the regular and merged paths - #534
Open
0w3n-d wants to merge 1 commit into
Open
Check the proposer payment on both the regular and merged paths#5340w3n-d wants to merge 1 commit into
0w3n-d wants to merge 1 commit into
Conversation
The recipient's whole-block balance delta decides first. When the proposer also spends, the payment must be recognisable: a direct transfer, or a PAYMENT_FORWARDER call where its runtime is deployed. Merged blocks sum the base payment tx and the trailing distribution tx. helix-common becomes a runtime dependency for the payment constants. Ports the current reth behavior unchanged, including the multiSend gap that #533 will close for both simulators at once. Step 5 of #527. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue: #527 (step 5 of 10)
Base branch:
od/builder-sim-execute-step4(#532, step 4). Retarget as thestack merges.
What this PR does
validatenow checks the proposer was paid, andvalidate_mergedadds therelay-internal merged path.
The recipient's whole-block balance delta decides first. It falls short only
when the proposer also spends in the block, and then the payment must be
recognisable in the last transaction: a direct transfer, or a
PAYMENT_FORWARDERcall where that runtime is actually deployed. Merged blockssum two positions, the base block's payment transaction at
base_payment_tx_indexand the appended distribution transaction.helix-commonmoves from a dev-dependency to a real one, for the paymentconstants and the shared
multisend_paid_amount. That settles the issue's openquestion about when the builder takes that dependency.
What this PR deliberately does not do
This ports the reth behavior unchanged, including the multiSend weakness in
#533: a payment is credited from calldata rather than from effect. Porting it
as-is keeps both simulators agreeing on what counts as a payment, so no merged
block is accepted by one relay simulator and rejected by another. #533 fixes
both at once in
helix-common.No test asserts that a fake multiSend is accepted, so nothing here has to be
un-asserted when #533 lands.
One check reth performs is absent: comparing every payment transaction's chain
id.
validate_block_pre_executionalready rejects a wrong chain id for everytransaction in the block. What survives is the case ethrex exempts — a legacy
transaction carrying no chain id at all — which the payment path still rejects.
Tests
Written first and signed off before implementation. 12 new, 32 in the file:
pre-EIP-155 payment are each rejected.
against the rise rather than towards it.
where it is absent, since a value call to a codeless address succeeds and
keeps the value. The genesis deploys the real 20-byte runtime from
contracts/README.md, so this executes rather than mocks.fails closed; the same block fails on the regular path, which pins the
difference between the two entry points.
The fixture's proposer is now a funded signer so it can spend. Without that the
balance delta covers every case and the fallback is never exercised.
just fmt-check,just testandcargo clippy --all-features --no-deps -- -D warningsare clean. 66 tests pass in
helix-builder, up from 54.Reviewer checklist
lint,unit-test) is green