Skip to content

txnprovider/shutter: follow up update for EIP-8037#21399

Merged
AskAlexSharov merged 1 commit into
mainfrom
worktree-shutter-8037
May 26, 2026
Merged

txnprovider/shutter: follow up update for EIP-8037#21399
AskAlexSharov merged 1 commit into
mainfrom
worktree-shutter-8037

Conversation

@taratorio
Copy link
Copy Markdown
Member

Summary

Addresses the TODO(yperbasis): revisit Shutter gas filtering for EIP-8037 in txnprovider/shutter/pool.go.

Why

The Shutter pool previously used txn.GetGasLimit() as a conservative proxy for both regular and state gas dimensions because it lacked access to the chain config needed to compute intrinsic gas. Two problems:

  • Over-conservative: it deducted the full gas limit from both availableGas.Regular and availableGas.State, and rejected any txn whose gas limit exceeded either dimension — even when the actual intrinsic state gas was 0 (e.g., simple transfers).
  • Misaligned with the base txpool's best(), which already filters by per-dimension intrinsic gas under EIP-8037.

What

  • Pass *chain.Config to shutter.NewPool so it can resolve fork flags from block time.
  • Replace the gasLimit-as-proxy filter with EIP-8037-aware per-dimension intrinsic gas filtering, matching txpool.best():
    • Compute per-dimension intrinsic gas via mdgas.IntrinsicGas with the right fork flags (EIP-3860 / 7623 / 7976 / 7981 / 8037).
    • Filter intrinsicRegularGas against availableGas.Regular and intrinsicGasResult.StateGas against availableGas.State independently.
    • Deduct only intrinsic gas from each dimension. Execution-time state gas remains enforced by applyTransaction in the block assembler.
  • Add Warn logs at every skip branch (overflow, insufficient regular / state / blob gas) with txn hash, type, sender, plus the relevant intrinsic and available gas values for the failing dimension.
  • New test TestPoolProvideTxnsFiltersByIntrinsicGasNotFullGasLimit — verified red against the previous code and green against the fix.

Test plan

  • go test ./txnprovider/shutter/...
  • make lint
  • make erigon
  • TDD red/green verified by temporarily restoring the old filter loop

@taratorio taratorio requested a review from mh0lt May 25, 2026 08:06
@AskAlexSharov AskAlexSharov added this pull request to the merge queue May 26, 2026
Merged via the queue into main with commit 029708f May 26, 2026
132 of 134 checks passed
@AskAlexSharov AskAlexSharov deleted the worktree-shutter-8037 branch May 26, 2026 08:38
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