feat: warn when the coinbase cannot cover the proposer payout tx#929
Open
MavenRain wants to merge 1 commit into
Open
feat: warn when the coinbase cannot cover the proposer payout tx#929MavenRain wants to merge 1 commit into
MavenRain wants to merge 1 commit into
Conversation
In L1 block building the proposer payout is an EIP-1559 transaction sent from the builder coinbase (max_fee_per_gas = basefee, max_priority_fee_per_gas = 0), so the EVM locks value + gas_limit * basefee up front. If the coinbase holds less than that, the payout tx is not sendable and block construction is silently corrupted, surfacing only as a downstream payout-tx revert. In the limiting value-less case the floor is BASE_TX_GAS * basefee (the "21k gas" case in the issue). Add proposer_payout_tx_cost(value, gas_limit, basefee) and, in insert_refunds_and_proposer_payout_tx, warn when the coinbase balance (read after the refunds, which also spend from the coinbase) is below that cost. Warn-only: no early return, the existing PayoutTxReverted path is unchanged. Closes flashbots#296 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Onyeka Obi <softwareengineerasaservant@isurvivable.cv>
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.
📝 Summary
Adds a warning when the builder coinbase cannot cover the proposer payout transaction, as requested in #296.
💡 Motivation and Context
In L1 block building the end-of-block proposer payout is an EIP-1559 transaction sent from the builder coinbase (
ctx.builder_signer) to the suggested fee recipient, withmax_fee_per_gas = basefeeandmax_priority_fee_per_gas = 0. The EVM locksvalue + gas_limit * basefeeup front, so if the coinbase holds less than that it cannot send the payout tx (in the value-less limit the floor isBASE_TX_GAS * basefee, i.e. the "21k gas" case in the issue). Today this only surfaces as a downstream payout-tx revert.This adds
proposer_payout_tx_cost(value, gas_limit, basefee)(saturatingvalue + gas_limit * basefee) and, insideinsert_refunds_and_proposer_payout_tx, emits atracing::warn!when the coinbase balance (read after the refunds, which also spend from the coinbase) is below that cost. It is warn-only: no early return, and the existingPayoutTxRevertedpath is unchanged.Closes #296
✅ I have completed the following steps:
make lint(cargo fmt + cargo clippy --all-targets -- -D warnings, clean on the rbuilder crate)make test(cargo test -p rbuilder --lib payout_tx: 4 passed)