Skip to content

fix: run gas-fee and blob-sidecar checks at BidBlock admission time#413

Closed
chee-chyuan wants to merge 1 commit into
develop-hardfork-pasteurfrom
fix/mev-preseal-admission-checks
Closed

fix: run gas-fee and blob-sidecar checks at BidBlock admission time#413
chee-chyuan wants to merge 1 commit into
develop-hardfork-pasteurfrom
fix/mev-preseal-admission-checks

Conversation

@chee-chyuan

Copy link
Copy Markdown
Contributor

Problem

admit_bid_block was missing two of the four checks that go-bsc performs synchronously in preSealVerifyBidBlock before queuing a BidBlock:

# go-bsc check Before this PR
1 VerifyUnsealedHeader deferred (miner-side)
2 BlockTimeUpperCheck deferred (miner-side)
3 ExtractBidBlockDepositValue + gas-fee validation missing at admission
4 validateBidBlockBlobSidecars missing at admission

Checks 1–2 still need Arc<Parlia<BscChainSpec>> wired into MevApiImpl and remain deferred. Checks 3–4 have no Parlia dependency and are added here.

Also adds the empty-txs guard from Miner.SendBidBlock (before decode).

Changes

  • src/rpc/mev.rs: in admit_bid_block, before add_pending_bid_block:
    • empty-txs reject (before decode, mirrors Miner.SendBidBlock line 97)
    • extract_bid_block_deposit_value + gas_fee.is_zero() reject
    • validate_bid_block_blob_sidecars (cheap checks only; KZG at insertion)
  • Updated comment to reflect that only the Parlia-dependent checks remain deferred.

Test plan

  • cargo clippy --workspace --tests --all-features passes
  • cargo test -p reth_bsc -- --test-threads=1 passes
  • Builder submitting a BidBlock with no deposit tx now gets an immediate empty gasFee error instead of being silently dropped

🤖 Generated with Claude Code

Mirrors go-bsc preSealVerifyBidBlock checks 3–4 synchronously in
admit_bid_block so builders receive immediate error feedback:
- empty-txs guard (before decode)
- extract_bid_block_deposit_value + zero gas-fee reject
- validate_bid_block_blob_sidecars (cheap; KZG deferred to insertion)

VerifyUnsealedHeader and BlockTimeUpperCheck (checks 1–2) require
Arc<Parlia<BscChainSpec>> which is not wired into MevApiImpl yet;
those remain deferred to simulate_bid_block miner-side.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@hashdit-bot

hashdit-bot Bot commented Jun 23, 2026

Copy link
Copy Markdown

Pull Request Review

This PR strengthens mev_sendBidBlock admission checks in a Rust-based blockchain node (reth-bsc, web3 infrastructure) by moving two go-bsc preSealVerifyBidBlock validations earlier into admit_bid_block: gas-fee extraction/zero-fee rejection and blob sidecar invariant validation. It also adds an early guard rejecting empty transaction lists before decode to reduce wasted processing. Overall, the change improves fail-fast behavior and aligns admission flow more closely with go-bsc while leaving Parlia-dependent header/time checks deferred miner-side.

Sensitive Content

No sensitive content detected.

Security Issues

No serious security issues detected.


Generated by Hashdit Bot. This tool can absolutely NOT replace manual audits.

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.

1 participant