Repository navigation
Conversation
load_validator_registry accepted any manifest whose attester and proposer entries shared an index. A manifest that assigned one key to both roles, or keys that differ from the genesis registry, loaded without error, and the node signed with them. leanSpec's ValidatorRegistry rejects a manifest that gives the same key to both roles, because XMSS is a stateful one-time signature and a validator signs a proposal and an attestation in the same slot. Each validator's keys must also equal its genesis entry, or every signature fails verification at peers. load_validator_registry now takes the genesis validators and fails on a shared key, a key that differs from genesis, or an index outside the genesis registry.
This branch has not been deployed
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.
What was wrong?
Bug:
load_validator_registry(crates/common/validator/lean/src/registry.rs) checks only that a validator's attester and proposer entries share the sameindex. It never checks the public keys:Problem:
ValidatorRegistryraisesValueErrorwhen the attestation and proposal keys are equal (src/lean_spec/node/validator/registry.py:217-226). XMSS is a stateful one-time signature, and a validator signs a proposal and an attestation in the same slot, so sharing one key across both roles reuses one-time state and breaks it.How was it fixed?
load_validator_registrynow takes the genesis validators. Before loading any secret key, it fails when:genesis_validators[index].main.rspassesconfig.network.genesis_validators. Startup already calls.expect(...)on the result, so a bad manifest stops the node with a clear message.New table-driven test
test_load_validator_registry_checks_keys_against_genesis:On current
master, the "same key for both roles" case loads without error.Limit: this compares the manifest's public keys with genesis. It cannot prove that the secret key file matches, because the leanSig backend used by the
devnet5build cannot derive a public key from a secret key. The leanVM backends can (XmssSecretKey::public_key()), so that check could follow in a separate PR.Checks run:
cargo test -p ream-validator-lean --no-default-features --features devnet5passes (13 s).cargo clippy -p ream-validator-lean --all-targets --no-default-features --features devnet5 -- --deny warningspasses.cargo +nightly fmt --all -- --checkpasses.cargo checkpasses for thereambinary (devnet5) and for the crate withoptimized-leanvm-b.I did not run the full workspace
make test: only the lean validator crate andmain.rschanged.Related, not changed here:
verify_checkpoint_statedoes not compare a checkpoint state's validators with genesis.To-Do