Simulate merged blocks and disable block merging on builder-attributable failures - #508
Open
0w3n-d wants to merge 1 commit into
Open
Simulate merged blocks and disable block merging on builder-attributable failures#5080w3n-d wants to merge 1 commit into
0w3n-d wants to merge 1 commit into
Conversation
5 tasks
…ble failures BlockMergingTile now sends every accepted merged block to the simulator via SimRequest::ValidateMerged, in addition to (not instead of) its existing immediate forward to the auctioneer -- the serving path is unchanged. The tile becomes a consumer of from_sim (already MPMC per spine-derive's defaults, confirmed no queue-declaration change needed) and filters for its own tagged SimResult::ValidateMerged results, ignoring the auctioneer's ordinary submission-validation results on the same queue. On a builder-attributable failure, block merging is disabled -- which alone triggers the existing force-disconnect gating from the previous step, so no separate disconnect call is needed -- and a critical Discord alert fires with the block hash, merge builder endpoint, and reason. "Builder-attributable" reuses BlockSimError::is_demotable() (the same logic used for bid-submission builder demotion) but additionally excludes internal channel/queue failures (SendError, SimulationDropped, HydrationMiss), which are relay/simulator-side infra hiccups rather than anything the merge builder did wrong. Temporary/infra errors and successes take no action. Nothing except the admin endpoint from the first step ever re-enables merging. SlotState gains registered_gas_limit/apply_blacklist/inclusion_list, captured from the same validator-registration and slot-event data that already feeds fee_recipient, to build each merged block's simulation request context. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
0w3n-d
force-pushed
the
od/merged_block_sim_step3
branch
from
August 25, 2026 12:58
0d45b49 to
fc9aa66
Compare
3 tasks
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 3 of 4)
Base branch:
od/merged_block_sim_step2(step 2, #506) -- stacked per CONTRIBUTING.md, not yet merged. Diff will shrink as earlier steps merge and this retargets down towarddevelop.What this PR does
BlockMergingTilenow sends every accepted merged block to the simulator viaSimRequest::ValidateMerged, in addition to (not instead of) its existing immediate forward to the auctioneer -- the serving path is unchanged. The tile becomes a consumer offrom_sim(confirmed via thespine-derivemacro source that every spine queue defaults to MPMC unless explicitly flaggedflavour("spmc"), so no queue-declaration change was needed for a second producer/consumer) and filters for its own taggedSimResult::ValidateMergedresults, ignoring the auctioneer's ordinary submission-validation results that flow through the same queue.On a builder-attributable failure, block merging is disabled -- which alone triggers the existing force-disconnect gating from #502, so no separate disconnect call is needed here -- and a critical Discord alert fires with the block hash, merge builder endpoint, and reason. "Builder-attributable" reuses
BlockSimError::is_demotable()(the same logic used for bid-submission builder demotion) but additionally excludesSendError/SimulationDropped/HydrationMiss, since those are relay/simulator-side infra hiccups rather than anything the merge builder did wrong --is_demotable()alone doesn't exclude them since it was calibrated for the bid-submission-demotion use case. Temporary/infra errors and successes take no action. Nothing except the admin endpoint from #502 ever re-enables merging.SlotStategainsregistered_gas_limit/apply_blacklist/inclusion_list, captured from the same validator-registration and slot-event data that already feedsfee_recipient, to build each merged block's simulation request context.What this PR deliberately does not do
No portal/admin-UI wiring for re-enabling merging -- that's step 4.
Tests
Written first, reviewed (including a correction: the initial draft classified
SendError/SimulationDroppedas disable-worthy sinceis_demotable()alone returns true for them; excluded per review since they're relay-side infra failures, not builder faults), then implemented against. The disable decision is extracted as a pure function (merge_sim_disable_check) so it's testable without constructing a full tile or triggering the (otherwise safe, since it's a no-op without a configured webhook URL) Discord alert call:merge_sim_disable_check_table: everyBlockSimErrorvariant/reason against expected disable/no-disable outcome.merge_sim_disable_check_reports_block_hash: the reported hash matches the actual merged block.merge_sim_disable_check_none_on_success: a successful simulation never disables merging.just fmt-check,cargo clippy --all-features --no-deps -- -D warnings, andjust test(full workspace) all pass.Reviewer checklist
lint,unit-test) is green