fix(rpc): gate testnet-rpc expected-bank-hash; template hardcoded shred-version#405
Merged
Conversation
…ed-version testnet-rpc/start-validator.sh.j2 emitted `--expected-bank-hash <stale> ` and a hardcoded `--expected-shred-version 57087` unconditionally. The bank hash is a coordinated-cluster-restart parameter; carrying a stale value into a normal restart can hang the node or fail with a bank-hash mismatch (same class of bug already fixed for the testnet *validator* templates in #402). Now: - expected-shred-version is templated with a default (overridable per host) - expected-bank-hash is gated behind `is defined` (emitted only when set) Also template the hardcoded `--expected-shred-version 50093` in the mainnet-rpc (index/grpc/tx/main + start-validator) and mainnet-validator start scripts so the shred version is overridable; the default preserves current behavior. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… defined
Review follow-up: `{% if x is defined %}` is true for a declared-but-empty var,
and the example inventories document `expected_bank_hash: ""` /
`wait_for_supermajority: ""` as the commented "unset" form. Uncommenting that
would render `--expected-bank-hash ` (empty) and break the launch. Gate on
`is defined and x` so empty-string/null also suppresses the flag. Applied to the
new testnet-rpc gate and the existing testnet-validator gates.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Problem
testnet-rpc/start-validator.sh.j2emitted, unconditionally and hardcoded:--expected-bank-hashis a coordinated-cluster-restart parameter. Carrying a stale value into a normal restart (e.g. a version upgrade) can hang the node or fail it with a bank-hash mismatch — the same class of bug already fixed for the testnet validator templates in #402. Hit live while upgrading a testnet Index RPC to jito 4.1.0-beta.2.Fix
testnet-rpc/start-validator.sh.j2:--expected-shred-version→{{ expected_shred_version | default("57087") }}(kept; needed for gossip, now overridable)--expected-bank-hash→ gated behind{% if expected_bank_hash is defined %}(emitted only when an operator explicitly sets it for a cluster restart)For consistency, the hardcoded
--expected-shred-version 50093in themainnet-rpcstart scripts (index/grpc/tx/main + start-validator) andmainnet-validator/start-validator.sh.j2is now templated with adefault("50093")— overridable, with no behavior change for existing hosts. (These have noexpected-bank-hash, so nothing to gate there.)Testing
Rendered
testnet-rpc/start-validator.sh.j2for jito/agave × Index/Geyser:--expected-bank-hashis absent when unset, present when set,--expected-shred-versionis retained, and no line-continuation/concatenation breakage. mainnet-rpc renders the templated shred version (default 50093).The testnet validator templates (already gated in #402) are unchanged.
🤖 Generated with Claude Code