mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-09 20:59:23 +00:00
We had a race condition where'd we be informed of blocks 1 .. 3, and immediately add 1 .. 3. Because we immediately tried to add 2 after 1, it'd fail since the tip was still the genesis, yet 2 needs the tip to be 1. Adding a channel, while ugly, was the simplest way to accomplish this. Also has any added block be broadcasted. Else there's a race condition where a node which syncs up to the most recent block does so, yet fails to add the next block when it's committed to.
Coordinator
The Serai coordinator communicates with other coordinators to prepare batches for Serai and sign transactions.
In order to achieve consensus over gossip, and order certain events, a micro-blockchain is instantiated.