Skip to content

feat: warn when the coinbase cannot cover the proposer payout tx#929

Open
MavenRain wants to merge 1 commit into
flashbots:developfrom
MavenRain:fix/coinbase-payout-balance-warning
Open

feat: warn when the coinbase cannot cover the proposer payout tx#929
MavenRain wants to merge 1 commit into
flashbots:developfrom
MavenRain:fix/coinbase-payout-balance-warning

Conversation

@MavenRain

Copy link
Copy Markdown

📝 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, with max_fee_per_gas = basefee and max_priority_fee_per_gas = 0. The EVM locks value + gas_limit * basefee up front, so if the coinbase holds less than that it cannot send the payout tx (in the value-less limit the floor is BASE_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) (saturating value + gas_limit * basefee) and, inside insert_refunds_and_proposer_payout_tx, emits a tracing::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 existing PayoutTxReverted path is unchanged.

Closes #296

✅ I have completed the following steps:

  • Run make lint (cargo fmt + cargo clippy --all-targets -- -D warnings, clean on the rbuilder crate)
  • Run make test (cargo test -p rbuilder --lib payout_tx: 4 passed)
  • Added tests

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>
@MavenRain MavenRain requested review from ZanCorDX and dvush as code owners July 6, 2026 14:45
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.

Check before block building whether coinbase has enough balance

1 participant