Add SimRequest::ValidateMerged and dispatch merged blocks through the simulator - #506
Open
0w3n-d wants to merge 1 commit into
Open
Add SimRequest::ValidateMerged and dispatch merged blocks through the simulator#5060w3n-d wants to merge 1 commit into
0w3n-d wants to merge 1 commit into
Conversation
This was referenced Aug 25, 2026
… simulator Merged blocks from the merge builder now get a SimRequest::ValidateMerged path through SimulatorTile, tagged separately in SimResult so a future consumer can distinguish it from ordinary submission validation. The merged block is converted to a synthetic SignedBidSubmission (real block_hash/parent_hash/gas_limit/gas_used/value/fee_recipient, zeroed signature and builder/proposer pubkeys) so it reuses the existing SSZ/JSON simulator dispatch. A new PendingMergeRequests queue, keyed by base_block_hash rather than builder pubkey, gives merged-block requests the same load-shedding behavior as ordinary submissions. Nothing consumes SimResult::ValidateMerged yet -- BlockMergingTile isn't wired up to send requests or read results. That's the next step. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
0w3n-d
force-pushed
the
od/merged_block_sim_step2
branch
from
August 25, 2026 12:58
f5ecb03 to
38d7f87
Compare
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: #500 (step 2 of 4)
Base branch:
od/merged_block_sim(step 1, #502) -- stacked per CONTRIBUTING.md, not yet merged. Diff will shrink once #502 merges and this retargets todevelop.What this PR does
Adds
SimRequest::ValidateMerged/SimResult::ValidateMergedso a merged block from the merge builder can be simulated through the existingSimulatorTilemachinery. A merged block is converted into a syntheticSignedBidSubmission(BidTrace.block_hash/parent_hash/gas_limit/gas_usedderived from the execution payload,valuefromproposer_value,proposer_fee_recipientfrom the request,builder_pubkey/proposer_pubkey/signaturezeroed -- the simulator never checks the BLS signature and these fields are otherwise cosmetic), so it reuses the same SSZ/JSON dispatch already used for ordinary bid submissions. A newPendingMergeRequestsqueue (keyed bybase_block_hash, since there's exactly one merge builder connection rather than many builder pubkeys) gives merged-block requests the same load-shedding behavior under simulator capacity pressure as ordinary submissions get fromPendingRequests.SimulatorTilegains read access tomerged_blocks(main.rs reordered so it's constructed beforeSimulatorTile::createinstead of after). The auctioneer'sFromSimMsgconsumer, which previously did an irrefutablelet SimResult::Validate(..) = .., now ignoresSimResult::ValidateMergedresults with anelse { return }-- it doesn't act on them in this step.What this PR deliberately does not do
Nothing sends a
ValidateMergedrequest yet, and nothing consumesSimResult::ValidateMerged.BlockMergingTileisn't wired up to dispatch requests or read results back, and there's no builder-attribution/disable-switch/Discord-alert logic. That's step 3.Tests
Written first, reviewed, then implemented against. A live end-to-end HTTP dispatch test isn't feasible here:
spawn_sim/spawn_merge_simdispatch viaspawn_tracked!, which panics unless a process-globalRUNTIMEwas already set up viainit_runtime(&RelayConfig)-- a one-time, real-core-pinning init meant for actual process startup, andspawn_simitself has no existing test either. So tests target the new, genuinely error-prone synchronous logic:merged_block_to_submission_derives_bid_trace_from_payload_and_context/merged_block_to_submission_converts_appended_blobs_to_blobs_bundle: the merged-block -> synthetic-submission conversion.pending_merge_requests_evicts_older_same_base_block/pending_merge_requests_keeps_existing_if_new_is_older/pending_merge_requests_next_req_returns_and_removes/pending_merge_requests_clear_empties_queue: the new queue's eviction/ordering.just fmt-check,cargo clippy --all-features --no-deps -- -D warnings, andjust test(full workspace) all pass.Reviewer checklist
lint,unit-test) is green