Stop validators from equivocating on reboot

Part of https://github.com/serai-dex/serai/issues/345.

The lack of full DB persistence does mean enough nodes rebooting at the same
time may cause a halt. This will prevent slashes.
This commit is contained in:
Luke Parker
2024-03-07 22:40:04 -05:00
parent 6c8a0bfda6
commit e266bc2e32
8 changed files with 55 additions and 5 deletions

View File

@@ -218,7 +218,7 @@ impl<D: Db, T: TransactionTrait, P: P2p> Tributary<D, T, P> {
TendermintNetwork { genesis, signer, validators, blockchain, to_rebroadcast, p2p };
let TendermintHandle { synced_block, synced_block_result, messages, machine } =
TendermintMachine::new(network.clone(), block_number, start_time, proposal).await;
TendermintMachine::new(db.clone(), network.clone(), block_number, start_time, proposal).await;
tokio::spawn(machine.run());
Some(Self {

View File

@@ -302,6 +302,8 @@ fn assert_target_block_time() {
#[async_trait]
impl<D: Db, T: TransactionTrait, P: P2p> Network for TendermintNetwork<D, T, P> {
type Db = D;
type ValidatorId = [u8; 32];
type SignatureScheme = Arc<Validators>;
type Weights = Arc<Validators>;