Convert a submitted payload to an ethrex block and locate its parent - #531
Open
0w3n-d wants to merge 1 commit into
Open
Convert a submitted payload to an ethrex block and locate its parent#5310w3n-d wants to merge 1 commit into
0w3n-d wants to merge 1 commit into
Conversation
3 tasks
BlockValidator turns an ExecutionPayloadV3 into the block it describes, checks the bid trace against that block, and finds the parent within the validation window. Nothing executes yet. The head comes from the node's watch channel rather than a store read per call, which keeps prepare synchronous. Step 3 of #527. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
0w3n-d
force-pushed
the
od/builder-sim-validation-step3
branch
from
August 29, 2026 14:03
e8cb893 to
f252ec9
Compare
vladimir-ea
approved these changes
Sep 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue: #527 (step 3 of 10)
Base branch:
od/sim-shared-payment-helpers-step2(#529, step 2). Retarget asthe stack merges.
What this PR does
Adds
BlockValidator. It turns anExecutionPayloadV3into the ethrex blockthe submission describes, checks the bid trace against that block, and finds the
parent inside the validation window.
payload_v3_to_blockis the inverse of theexisting
block_to_payload_v3.Two departures from the reth simulator, both deliberate:
watchchannel, not a store read percall, so
preparestays synchronous. A lagging head can only shorten themeasured distance, so it errs toward accepting, never rejecting.
registered_gas_limitis not threaded in. reth's_validate_gas_limitisdead code there, so there is nothing to port.
Also extracts the merge-engine test fixture's shared primitives into
src/testing.rs. Every later validation step needs them, and the merge-specificFixturestays where it is.What this PR deliberately does not do
Nothing executes. No EVM, no state root, no payment, no blacklist.
maindoesnot reach
BlockValidatoryet either, which is why the module carries anallow(dead_code)until step 9 wires the servers.Checks ethrex already performs are not reported here: the header against the
parent, the RLP block size and the per-tx chain id all live in
validate_block_pre_execution, which step 4 calls.Tests
Written first and signed off before implementation
(
src/validation/tests.rs, 12 tests on an in-memory devnet chain):an undecodable transaction is rejected.
each rejected, in that order. A payload edited after signing fails on the
block hash rather than a per-field check.
are rejected; one inside it passes.
BlockSimError::BlockValidationFailed(err.to_string())still reachesis_temporary()andis_too_old(). This pins the two error strings the relaymatches on. Get them wrong and a transient failure demotes the builder.
just fmt-check,just testandcargo clippy --all-features --no-deps -- -D warningsare clean. 46 tests pass in
helix-builder, up from 34.Reviewer checklist
lint,unit-test) is green