Skip to content

fix(rpc): simulate mev_simBundle in the block after parentBlock - #27266

Open
Bruce039 wants to merge 1 commit into
paradigmxyz:mainfrom
Bruce039:fix/sim-bundle-next-block-env
Open

Bruce039 wants to merge 1 commit into
paradigmxyz:mainfrom
Bruce039:fix/sim-bundle-next-block-env

Conversation

@Bruce039

Copy link
Copy Markdown

mev_simBundle executed the bundle in the parent block's own environment and checked the inclusion range against the parent number, so the standard request with inclusion.block = latest + 1 failed with invalid inclusion, and coinbase/baseFee were read before the overrides were applied. The reference implementation (flashbots sbundle_api.go) simulates in the block that builds on parentBlock (number + 1, timestamp + 12, next base fee, then overrides) and checks inclusion against that block.

Derives the next block env the same way eth_simulateV1 does, applies the overrides first and checks inclusion against the simulated block; stateBlock still reports the parent.

The bundle was executed in the parent block's own environment and the
inclusion range was checked against the parent number, so the standard
request with inclusion.block = latest + 1 failed with "invalid inclusion"
and the profit was measured against the coinbase before overrides.
Derive the next block env like eth_simulateV1 does, apply overrides
first and check inclusion against the simulated block, matching
flashbots' sbundle_api.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

1 participant