Skip to content

fix: derive BlobParams from chain spec instead of hardcoding#254

Merged
dylanlott merged 2 commits intomainfrom
evalir/fix/derive-blob-params-from-chainspec
Mar 31, 2026
Merged

fix: derive BlobParams from chain spec instead of hardcoding#254
dylanlott merged 2 commits intomainfrom
evalir/fix/derive-blob-params-from-chainspec

Conversation

@Evalir
Copy link
Copy Markdown
Member

@Evalir Evalir commented Mar 30, 2026

Closes ENG-2110

Summary

populate_initial_gas hardcoded BlobParams::prague() when computing max_fee_per_blob_gas for host chain blob transactions. When the network moved to BPO2, the exponential blob pricing formula amplified the parameter mismatch into an astronomically wrong blob fee.

Concretely, the mismatch affects both inputs to the blob fee exponential:

  1. Target blob gas: Prague uses 786,432 vs BPO2's 1,835,008 — the builder subtracts less from excess, computing a higher excess value
  2. Update fraction: Prague uses 5,007,716 vs BPO2's 11,684,671 — the builder divides by a smaller denominator, inflating the exponent further
  3. blob_base_cost: Prague uses 0 (never takes the Osaka scaled-excess branch) vs BPO2's 8,192 — the builder uses a completely different excess formula than the network

With ~187M excess_blob_gas on the network (reachable in ~60 min of sustained blob demand, where the real blob fee is only ~9M wei per blob gas), the builder computes an exponent of 37.5 instead of the correct 15.3, producing a max_fee_per_blob_gas of ~20 quadrillion wei — 2.1 billion times higher than reality. This caused eth_estimateGas to report a required balance of ~2,618 ETH for a single blob transaction, failing with -32003: insufficient funds.

Fix

Replace the hardcoded BlobParams::prague() with dynamic resolution via EthChainSpec::blob_params_at_timestamp(), using the same chain spec that SignetCfgEnv::spec_id() already uses. This handles the full Cancun -> Prague -> Osaka -> BPO1 -> BPO2 schedule automatically, so the builder will always use the correct blob parameters for the current hardfork.

Test plan

  • make clippy passes with -D warnings
  • make test — all tests pass
  • Deploy to a mainnet builder and confirm blob transactions submit successfully

Generated with Claude Code

Resolve BlobParams dynamically via EthChainSpec::blob_params_at_timestamp()
rather than hardcoding a specific hardfork variant. The hardcoded value
caused the builder to compute astronomically wrong max_fee_per_blob_gas
when the network moved to a different hardfork (e.g. Prague params on a
BPO2 network), due to mismatched target gas and update fraction values
feeding into the exponential blob pricing formula.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Member Author

Evalir commented Mar 30, 2026

This stack of pull requests is managed by Graphite. Learn more about stacking.

@Evalir Evalir marked this pull request as ready for review March 30, 2026 17:59
@dylanlott dylanlott merged commit b8114ea into main Mar 31, 2026
6 checks passed
@dylanlott dylanlott deleted the evalir/fix/derive-blob-params-from-chainspec branch March 31, 2026 01:48
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