Extend timeout for rebroadcast of consensus messages in coordinator

This commit is contained in:
Luke Parker 2024-03-22 16:06:26 -04:00
parent e0259f2fe5
commit 2f07d04d88
No known key found for this signature in database
2 changed files with 2 additions and 4 deletions

View file

@ -207,7 +207,7 @@ impl<D: Db, T: TransactionTrait, P: P2p> Tributary<D, T, P> {
for msg in to_rebroadcast {
p2p.broadcast(genesis, msg).await;
}
tokio::time::sleep(core::time::Duration::from_secs(1)).await;
tokio::time::sleep(core::time::Duration::from_secs(60)).await;
}
}
})

View file

@ -331,14 +331,12 @@ impl<D: Db, T: TransactionTrait, P: P2p> Network for TendermintNetwork<D, T, P>
// until the block it's trying to build is complete
// If the P2P layer drops a message before all nodes obtained access, or a node had an
// intermittent failure, this will ensure reconcilliation
// Resolves halts caused by timing discrepancies, which technically are violations of
// Tendermint as a BFT protocol, and shouldn't occur yet have in low-powered testing
// environments
// This is atrocious if there's no content-based deduplication protocol for messages actively
// being gossiped
// LibP2p, as used by Serai, is configured to content-based deduplicate
let mut to_broadcast = vec![TENDERMINT_MESSAGE];
to_broadcast.extend(msg.encode());
// TODO: Prune messages from old rounds which are no longer necessary
self.to_rebroadcast.write().await.push(to_broadcast.clone());
self.p2p.broadcast(self.genesis, to_broadcast).await
}