feat(spartan): configurable HA validator replica count#22384
Merged
alexghr merged 4 commits intomerge-train/spartanfrom Apr 8, 2026
Merged
feat(spartan): configurable HA validator replica count#22384alexghr merged 4 commits intomerge-train/spartanfrom
alexghr merged 4 commits intomerge-train/spartanfrom
Conversation
…eration VALIDATOR_REPLICAS is the default pod count per release. When VALIDATOR_PRIMARY_REPLICA_COUNT or VALIDATOR_HA_REPLICA_COUNT override it, the keystone (web3signer) and deploy script must generate attester keys and addresses for max(primary, HA) nodes to cover all pods. - Terraform: add max_validator_nodes local, use it for web3signer NODE_COUNT and publisher key index spacing - deploy_network.sh: compute VALIDATOR_INDICES dynamically from max node count, fix TOTAL_VALIDATOR_PUBLISHERS to sum actual pod counts across releases
…CAS as primary count VALIDATOR_REPLICAS already serves as the primary pod count — no need for a separate override. Now only two variables control pod counts: - VALIDATOR_REPLICAS: primary release pod count (was already the default) - VALIDATOR_HA_REPLICA_COUNT: HA release pod count (defaults to VALIDATOR_REPLICAS) staging-public: VALIDATOR_REPLICAS=2, VALIDATOR_HA_REPLICA_COUNT=4
alexghr
approved these changes
Apr 8, 2026
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.
Summary
Makes validator and HA validator pod counts independently configurable. Adds two new optional variables:
VALIDATOR_PRIMARY_REPLICA_COUNT: Override pod count for the primary validator release (defaults toVALIDATOR_REPLICAS)VALIDATOR_HA_REPLICA_COUNT: Override pod count for HA validator releases (defaults toVALIDATOR_REPLICAS)VALIDATOR_REPLICASremains the canonical "node slot count" used for key derivation and publisher key stride. The new variables only affect how many pods each release runs.staging-public configuration
Sets staging-public to run 2 primary validators + 4 HA validators:
This means attester slots 0-1 are served by both primary and HA, while slots 2-3 are served only by HA nodes. When HA runs a different image (via
VALIDATOR_HA_DOCKER_IMAGE), this forces mixed-version consensus.Changes
variables.tf: AddedVALIDATOR_PRIMARY_REPLICA_COUNTandVALIDATOR_HA_REPLICA_COUNT(bothnumber, defaultnull)main.tf: Movedvalidator.replicaCountfrom shared settings to per-release, usingcoalesce()to fall back toVALIDATOR_REPLICASdeploy_network.sh: Passes both new variables through env → tfvarsstaging-public.env: Set to 2 primary + 4 HA