Skip to content

Rollout for adding EIP-2335 path for Prysm VC key loading - #22

Open
syjn99 wants to merge 5 commits into
developfrom
feat/wallet-demotion
Open

Rollout for adding EIP-2335 path for Prysm VC key loading#22
syjn99 wants to merge 5 commits into
developfrom
feat/wallet-demotion

Conversation

@syjn99

@syjn99 syjn99 commented Jul 14, 2026

Copy link
Copy Markdown
Owner

No description provided.

syjn99 and others added 5 commits July 12, 2026 19:07
The web3signer keymanager only needs its SetupConfig, but construction was
routed through wallet.InitializeKeymanager, requiring a fake in-memory
wallet (NewWalletForWeb3Signer) just to satisfy the interface. Construct it
directly instead:

- WaitForKeymanagerInitialization gains a web3SignerConfig case calling
  remoteweb3signer.NewKeymanager; the wallet switch loses its Web3Signer
  branch and InitKeymanagerConfig loses the Web3SignerConfig field.
- getWallet returns no wallet for web3signer; the legacy slashing-protection
  database lookup keeps using the wallet dir flag for web3signer.
- The RPC server derives walletInitialized and the keymanager kind from the
  validator service's remote signer config when no wallet exists, keeping
  keymanager API behavior identical for web3signer setups.
- The accounts exit CLI builds the web3signer keymanager directly, matching
  the interop path.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Decouple the local keymanager from the concrete wallet by defining an
AccountStore interface (Load/Save/WatchPath) as its persistence backend, with
two implementations:

- walletStore wraps the legacy wallet and preserves the single encrypted
  all-accounts.keystore.json blob byte for byte (zero behavior change).
- dirStore loads a plain directory of standalone EIP-2335 keystore files — the
  format shared with other consensus clients — with passwords from a shared
  file or Teku-style per-keystore <name>.txt files.

The fsnotify refresh loop now watches the store's path (blob file vs. keys
directory) and reloads through it, and imports carry the incoming keystores
down so dirStore persists them verbatim (no re-encryption) with their
passwords; deletes remove the per-key files. A single-listener guard ensures
at most one watcher goroutine runs per keymanager.

Nothing constructs a dirStore yet, so all existing wallet behavior is
unchanged; this is the groundwork for direct keystore loading.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ding

New flags let the validator client start from a plain directory of EIP-2335
keystore files, no wallet required. Key-source resolution in the node picks
exactly one source in priority order (interop, web3signer, --validator-keys,
legacy --wallet-dir); --validator-keys with --wallet-dir is a startup error,
and --keystore-passwords is required alongside --validator-keys.

The RPC server treats a configured account store like an initialized wallet
so the keymanager API works over the new source.

This completes Phase 2 of the wallet demotion plan.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The validator RPC server no longer gates the keymanager API on a Prysm wallet
being initialized. A keymanager always exists after startup (wallet,
web3signer, direct keystore dir, or, with --rpc and no source, an empty local
keymanager over <datadir>/keystores), so the walletInitialized guards and the
walletInitializedFeed onboarding plumbing are gone. Running headless with no
key source now fails fast with an actionable error.

Per the plan's recommended variant, the frozen web UI is deleted outright
rather than rewired: validator/web assets, the catch-all web handler and /api
rewrite, the Prysm-specific wallet HTTP endpoints (/v2/validator/wallet/*,
/v2/validator/initialize), EnableWeb, and WriteWalletPasswordOnWebOnboarding.
Both feature flags become deprecated no-ops. The standard keymanager API used
by third-party UIs and DVT tooling is unaffected, and the auth token continues
to secure it.

This completes Phase 3 of the wallet demotion plan.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
validator accounts import/list/delete/backup/voluntary-exit now resolve their
key source through keySourceForAccounts: a --validator-keys directory of
EIP-2335 keystores (with --keystore-passwords) when set, otherwise the legacy
wallet. Commands that only used the keymanager work unchanged; list tolerates
a nil wallet, and a directly-imported private key takes its password from
--account-password-file when no wallet backs the CLI.

`validator wallet create|recover`, `--wallet-dir`, and opening a legacy wallet
now log a deprecation notice pointing at the new flags. The wallet paths keep
working through the deprecation window.

This completes Phase 4 of the wallet demotion plan.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant