Repository navigation
Description
Hey, fourth one from me today. This one is in quake, the testnet orchestrator, and it is dev tooling only, no mainnet impact. That is why it is Medium, not High.
Problem
public_key_overrides() (crates/quake/src/manifest.rs:1089-1100, docstring says "node index (1-based)") enumerates ALL nodes in the manifest and keys each remote signer override by the node's global position:
for (i, node) in self.nodes.values().enumerate() { // ALL nodes, not just validators
if let Some(key_id) = node.remote_signer {
let key_idx = key_id.get() - 1;
overrides.insert(i + 1, get_predefined_public_key(key_idx).to_string());
}
}The hardhat genesis builder (scripts/genesis/AccountCreator.ts:232-259) reads those keys as registrationIDs, 1-based over VALIDATORS only:
validators = async () =>
await Promise.all(
Array.from({ length: this.numValidators }).map(async (_, i) => {
const registrationID = i + 1; // 1-based index over VALIDATORS only
const publicKey = this.overridePublicKeys.has(registrationID)
? this.overridePublicKeys.get(registrationID)!
: /* mnemonic-derived key m/44'/60'/0'/1/${i + 2} */;The two index domains disagree whenever the manifest's node list is not validators first, in order.
What breaks
Case A: manifest [full1, validator1(remote_signer=1), validator2]. Quake emits override 2:. Hardhat reads key 2 as registrationID 2, validator2. Genesis gives validator2 the remote signer's key, while validator1 keeps its mnemonic-derived key, but validator1's CL signs remotely with KEY1. Votes signed with KEY1 are attributed to validator2, and validator2's own CL holds a mnemonic-derived key that matches no genesis entry. Both validators are broken.
Case B: manifest [full1(remote_signer=1), validator1, validator2]. Quake emits override 1:. Hardhat stamps KEY1 onto validator1, which does not use remote signing at all. Validator1's CL holds the deterministic mnemonic key, which no longer matches genesis. Validator1 can never produce a valid vote, a dead validator from a config the code itself blesses. validate() only warns for a full node with remote_signer set, and a test asserts it works (test_validate_full_node_can_use_remote_signer, manifest.rs:1805-1815).
Why it is silent: neither side validates the mapping. parseOverridePublicKeys only checks id >= 1. Out-of-range IDs are silently ignored and in-range-but-wrong IDs silently applied. generate_genesis_file never checks overrides against the validator list. No step compares the genesis validator keys against the keys quake assigned to nodes.
Why it has not blown up: every shipped scenario lists validators first, so global index equals validator index there. The bug needs a hand-written manifest with a non-validator node before a remote-signer validator, a normal layout, sentry or full nodes listed first, and one the code accepts without any error or warning.
Reproduction
Two parts. Part 1 is the real quake code (temporary unit tests appended to crates/quake/src/manifest.rs): repro_override_index_uses_global_node_index (Case A, asserts the override is keyed 2, the global index, not 1) and repro_full_node_remote_signer_injects_validator_override (Case B, asserts a lone full node with remote_signer produces override key 1).
Rust repro output (run finished 2026-11-13T07:58:11Z, cargo test -p quake --bin quake manifest::tests::repro_override_index_uses_global_node_index and ...::repro_full_node_remote_signer_injects_validator_override):
=== CASE A: repro_override_index_uses_global_node_index ===
REPRO overrides: {2: "0x22faef225605e08abb380a5da398b609b6641cd7d1e4d718cc0fe6ecd8a2a094"}
test manifest::tests::repro_override_index_uses_global_node_index ... ok
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 391 filtered out; finished in 0.00s
=== CASE B: repro_full_node_remote_signer_injects_validator_override ===
REPRO full-node overrides: {1: "0x22faef225605e08abb380a5da398b609b6641cd7d1e4d718cc0fe6ecd8a2a094"}
test manifest::tests::repro_full_node_remote_signer_injects_validator_override ... ok
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 391 filtered out; finished in 0.00s
Part 2 mirrors the hardhat consumer (Node script, faithful copy of parseOverridePublicKeys + the validators() registrationID loop):
Case A — quake override string: "2:0x22faef225605e08abb380a5da398b609b6641cd7d1e4d718cc0fe6ecd8a2a094"
[
{ "registrationID": 1, "publicKey": "<mnemonic-derived key for validator index 0>" },
{ "registrationID": 2, "publicKey": "0x22faef225605e08abb380a5da398b609b6641cd7d1e4d718cc0fe6ecd8a2a094" }
]
=> validator1 (registrationID 1) keeps a mnemonic key, but its CL signs REMOTELY with KEY1; validator2 (registrationID 2) is assigned KEY1 in genesis, while its CL holds a mnemonic key matching nothing. Both validators are broken.
Case B — quake override string: "1:0x22faef225605e08abb380a5da398b609b6641cd7d1e4d718cc0fe6ecd8a2a094"
[
{ "registrationID": 1, "publicKey": "0x22faef225605e08abb380a5da398b609b6641cd7d1e4d718cc0fe6ecd8a2a094" },
{ "registrationID": 2, "publicKey": "<mnemonic-derived key for validator index 1>" }
]
=> validator1 genesis key is KEY1, but its CL holds the mnemonic-derived key: validator1 can never produce a valid vote (dead validator).
Control — validators-first manifest: "1:0x22fa..." => validator1 gets KEY1. Correct.
Fix
In manifest.rs:1089-1100, enumerate validators only, in manifest order, so the key is the validator registrationID the hardhat builder expects. This also aligns with validator_names() (manifest.rs:801-809) and generate_app_private_keys (setup.rs:457-470), all three already use the validator-only order:
pub fn public_key_overrides(&self) -> IndexMap<usize, String> {
let mut overrides = IndexMap::new();
for (i, node) in self
.nodes
.values()
.filter(|n| n.node_type == NodeType::Validator)
.enumerate()
{
if let Some(key_id) = node.remote_signer {
let key_idx = key_id.get() - 1; // Convert to 0-based index
overrides.insert(i + 1, get_predefined_public_key(key_idx).to_string());
}
}
overrides
}Also update the docstring ("validator index (1-based, in manifest order)" instead of "node index (1-based)"), and decide the full-node case explicitly: with this fix a full node with remote_signer set contributes no override, so test_validate_full_node_can_use_remote_signer's contains_key(&1) assertion needs updating to assert an empty map.
What this is not
This is not #322 or its fix PR #328. Those are about parser strictness, non-canonical IDs like 1.5, 1e0, 01 accepted by Number(...). This is the quake-side index domain mismatch, a different bug, different file, different layer. And it is not #499. That one is about genesis cache metadata ignoring override mappings between runs. This one produces a wrong genesis on a single run regardless of caching.
Activity
osr21 commentedon Nov 13, 2026
I checked the release/0.8 implementation on both sides: Quake enumerates all manifest nodes for override keys, while AccountCreator assigns those keys to validator-only registration IDs. The index-domain mismatch described here is present, and filtering to validators in manifest order is consistent with the consumer.
One useful follow-through is to test the real cross-language contract, not only a mirrored TypeScript loop: generate an override from manifests such as [full node, validator] and [validator, full node, validator], then assert the actual genesis validator public keys match the configured remote-signer keys at each registration ID. Also make the full-node remote_signer behavior explicit—reject it during manifest validation, or intentionally ignore it and assert an empty override map. The existing full-node test currently codifies an override, so changing the generator without revising that test would preserve the old, misleading expectation.
References: Quake override generator · genesis consumer.