draft: proof of concept for plan-before-write validator-key recovery (#407, #572) - #1213
Draft
Crackdevs wants to merge 1 commit into
Draft
draft: proof of concept for plan-before-write validator-key recovery (#407, #572)#1213Crackdevs wants to merge 1 commit into
Crackdevs wants to merge 1 commit into
Conversation
Crackdevs
marked this pull request as draft
September 6, 2026 20:56
Author
|
Could a maintainer please approve the GitHub Actions workflow runs for this PR? Thank you! |
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.
Status: This is an unfunded feasibility prototype for a Round 40 grant application, not a production-complete or merge-ready implementation. It demonstrates the recovery-plan model, plan/commit separation, inactive-validator filtering fix, and zero-write safety test. Remaining work includes integration into
recover,rebuild, andtest-recovery; CLI/API behavior; production writer adapters; broader failure-path tests; documentation; and maintainer-requested revisions.Description
This PR introduces the Safe Recovery Planner & Per-Key Diagnosis architecture for validator key recovery, prototyping a solution for #407 and #572; #440 provides operator-impact context.
Previously, Smartnode persisted validator keys to disk immediately as each individual key was discovered. In mixed-key setups (mnemonic-derived, custom EIP-2335 keystores, megapools), encountering an error on a later key left the operator in a partially-written, inconsistent state. Additionally, inactive/exited validators on the Beacon chain were filtered into
filteredPubkeys, but the target map was populated from the unfiltered list, causing recovery to fail on exited validators (#407).Key Architectural Changes
shared/services/recovery):PlanValidatorRecovery): Pure, read-only discovery that assesses minipool/megapool keys, checks Beacon statuses, inspects custom keys, tests mnemonic derivation, and checks installed keystores. Zero disk writes.CommitPlan): Enforces the safety invariant: in default mode, if any in-scope key is unresolved or invalid, recovery halts before touching disk (ErrUnresolvedKeysRefusingCommit). An explicit--allow-partial-recoveroption allows committing only validated keys while recording skipped keys.types.ValidatorPlanEntry):mnemonic_valid,custom_valid,installed_valid,unresolved,invalid_material, andexcluded_inactive.recoverNodeKeysinrocketpool/api/wallet/recover.gosopubkeyMapcorrectly iterates overfilteredPubkeys.TestMixedRecoveryWithOneUnresolvedKey_DefaultFlowZeroWritesasserting through a writer-spy test thatwriterSpy.TotalWrites() == 0on unresolved key failure under default mode.Testing Done
go test -v -count=1 ./shared/services/recovery/...(All 6 test suites passing)go test -v -count=1 ./rocketpool/api/wallet/...(All wallet tests passing)golangci-lint/v2@v2.13.1with 0 issues.Note for maintainers: As this is a contribution from a new fork, the GitHub Actions workflows are awaiting approval to run (
action_required). Could a maintainer please approve the workflow runs? Thank you!