Skip to content

Commit

Permalink
Merge pull request #4116 from anoma/tiago/comet-genesis-validator-set
Browse files Browse the repository at this point in the history
Add a single CometBFT dummy validator
  • Loading branch information
mergify[bot] authored Nov 29, 2024
2 parents c61bbe0 + 1021625 commit 1362f34
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Only write a dummy validator to CometBFT's genesis if the number of validators
present is lower than 2. ([\#4116](https://github.com/anoma/namada/pull/4116))
18 changes: 10 additions & 8 deletions crates/node/src/tendermint_node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -370,14 +370,16 @@ async fn write_tm_genesis(
// validator unless we insert a dummy. If cometbft thinks a node is the
// only validator, it won't start state sync. These validators are
// overwritten after init chain is called.
const DUMMY_VALIDATOR: [u8; 32] = [
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
];
genesis.validators.push(Info::new(
PublicKey::from_raw_ed25519(&DUMMY_VALIDATOR).unwrap(),
10u32.into(),
));
if genesis.validators.len() < 2 {
const DUMMY_VALIDATOR: [u8; 32] = [
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18,
19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
];
genesis.validators.push(Info::new(
PublicKey::from_raw_ed25519(&DUMMY_VALIDATOR).unwrap(),
10u32.into(),
));
}
const EVIDENCE_AND_PROTOBUF_OVERHEAD: u64 = 10 * 1024 * 1024;
let size = block::Size {
// maximum size of a serialized Tendermint block.
Expand Down

0 comments on commit 1362f34

Please sign in to comment.