feat(elections): use static ADNL address by default#145
Merged
Keshoid merged 8 commits intoMay 18, 2026
Merged
Conversation
…r-tick persistence
…adnl-address-in-elections-by-default
ITBear
approved these changes
May 16, 2026
Lapo4kaKek
approved these changes
May 17, 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
Static ADNL was added as an opt-in in SMA-81. This PR makes it the default: nodectl auto-generates and persists a static ADNL per node on the first election cycle and reuses it thereafter. The motivation is that rotating ADNL every cycle breaks the Rust node's fastsync — peers that knew the validator by its previous ADNL can't locate it after the swap.
Existing
elections.static_adnlsentries continue to work unchanged. Operators who want the old per-cycle ephemeral behavior for a specific node can opt out.Design
Precedence per node, evaluated each tick:
elections.static_adnl_disabledset → fresh ephemeral ADNL each cycle (legacy behavior).elections.static_adnls[node]entry → re-register that static address.Batched persistence. The runner has a per-tick "ensure static ADNL" prefix step. It collects all nodes missing a static ADNL (not disabled, not yet generated), generates each via the validator's control server, then persists every success in a single
runtime_cfg.update_and_save(...)call — so 40 fresh nodes hit the config file once, not 40 times. After the first successful tick the step is a no-op.Partial failure handling. If 38/40 succeed and 2 fail (e.g. control server temporarily unreachable), the 38 are saved; the 2 failed nodes skip this election cycle (their
resolve_adnl_addrreturns an error → that node's participation fails, others proceed). Next tick retries only the still-missing ones. Matches the existing pool_addr_cache pattern.API
POST /v1/elections/static-adnl— unchanged, generates/rotates the static ADNL. Now also clearsstatic_adnl_disabledfor the node (rotation re-enables the static default).DELETE /v1/elections/static-adnl/{node}— new — opt the node out of static ADNL.BindingElectionStatusDtogainsstatic_adnl_disabled: bool, surfaced inGET /v1/elections/settings.CLI
elections shownow renders "disabled" in the Static ADNL column for opted-out nodes.Closes SMA-87