Skip to content

Commit

Permalink
Merge pull request #4118 from anoma/mergify/bp/maint-0.46/pr-4116
Browse files Browse the repository at this point in the history
Add a single CometBFT dummy validator (backport #4116)
  • Loading branch information
mergify[bot] authored Nov 29, 2024
2 parents 65e1f67 + 8931c89 commit 71fd328
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 71fd328

Please sign in to comment.