Add --custom-spec-support flag for non-mainnet SSZ presets#176
Open
AntiD2ta wants to merge 2 commits into
Open
Add --custom-spec-support flag for non-mainnet SSZ presets#176AntiD2ta wants to merge 2 commits into
AntiD2ta wants to merge 2 commits into
Conversation
Build the go-eth2-client HTTP client with WithCustomSpecSupport when the new --custom-spec-support persistent flag is set, switching from the static mainnet fastssz decoder to dynamic-ssz. Without it, decoding a non-mainnet preset beacon state (e.g. Gnosis) fails with: invalid ssz encoding. first variable element offset indexes into fixed value data because the static mainnet-preset decoder misreads the variable-length offsets of a Gnosis-preset BeaconState. This blocks "validator exit --prepare-offline" against a Gnosis node, which fetches the full beacon state via SSZ. Threads the flag through ConnectOpts and connectToBeaconNode, and wires it into the validator exit command's ConnectToBeaconNode call, mirroring the existing --allow-insecure-connections plumbing.
- Reword the --custom-spec-support help string to match the register of neighboring flag descriptions and disclose that it is currently honoured only by the 'validator exit' command. - Add a doc comment to the exported ConnectOpts type. - Replace the adjacent positional booleans in connectToBeaconNode with a named-field beaconNodeConnection struct so the three call sites are self-documenting; the mainnet fallback's forced allowInsecure is now explicit at the call site. Behaviour-preserving cleanup; no functional change to the feature.
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.
Adds a
--custom-spec-supportpersistent flag (defaultfalse) that switches the go-eth2-client HTTP consensus client from the built-in static SSZ decoder to a dynamic SSZ decoder, enabling ethdo to handle non-mainnet presets such as the Gnosis chain.The dynamic decoder is slower than the static one, so the flag defaults to off and engages only when explicitly set. It is currently honoured by the
validator exitcommand.No unit tests were added: the changes are config plumbing over an external-I/O-only connection path, for which the appropriate layer is an RPC integration test against a live beacon node (not present in this repo).
Gnosis validators were exited using this code successfully. This works as an integration test confirming
--custom-spec-supportdecodes a real Gnosis beacon state.