Refuse an unsupported fork on the SSZ validation path - #564
Open
0w3n-d wants to merge 1 commit into
Open
Conversation
The SSZ dispatch short-circuited above the fork gate #517 added, so a Gloas submission reaching an SSZ simulator was validated as Fulu. Gate both dispatch kinds, and have the simulation role refuse a fork it does not understand instead of discarding `decoder_params.fork_name`. Answer 501, not 400. The relay maps a 400 body to a demotable error, and this is helix's own limitation. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
7 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: #561 (step 1 of 6)
What this PR does
Closes the hole #517 left open. That PR stopped Gloas submissions being
mis-routed to the Electra-shaped JSON RPC, but
simulator/tile.rschose itsdispatch like this:
An SSZ simulator — which is how the ethrex simulation role is reached — got
every fork, including Gloas, and validated it as Fulu.
Both sides now refuse:
ssz_request_buildertakes a fork and returnsNonefor one itcannot validate, mirroring
sim_request_builder. The dispatch is a singlematchso neither branch can skip the gate again. The two kinds keepseparate fork lists, because the SSZ and JSON validators are different
implementations — step 3 turns Gloas on for SSZ while reth still cannot.
decoder_params.fork_name, which itpreviously received and discarded, on both
/validateand/validate_merged.Why 501 and not 400
SimulatorClient::ssz_requestmaps 400 toBlockValidationFailed, which isdemotable, and anything else to
RpcError, which is not. Refusing a fork ishelix's own limitation, so a 400 would cost a builder its optimistic status for
our gap.
refusing_an_unsupported_fork_cannot_demote_a_builderpins that.What this PR deliberately does not do
Adds no Gloas support. After this the relay declines to send Gloas to an SSZ
simulator and the simulator declines to accept it — which is the correct
behaviour until step 3, not a workaround.
Tests
6 new, written before the implementation and signed off first.
ssz_request_builder_routes_fuluunchanged;ssz_request_builder_refuses_gloasis the regression./validateis refused; the same for/validate_merged, which had the identical hole; a Fulu request is stillvalidated; and the refusal cannot demote a builder.
151 pass in helix-builder (was 147), 127 in helix-relay (was 125).
Reviewer checklist
lint,unit-test) is green