mina
mina copied to clipboard
Fetch Completed Snark on Bootstrap in order to fix high Snark Bid Variance and empty blocks
Problem There are occasionally some unusually high snark bids that make it into blocks: see https://minaexplorer.com/analytics/snarks. This happens when block producers go offline and then back online before they are selected in a subsequent slot. Since the snark order book is constructed from purely gossip this makes the bid significantly less likely to be the most optimal.
Solution On bootstrap it makes sense to fetch completed work from connected peers. The intention should be to fetch some batch of bids via rpc and apply/broadcast these bids to our own internal state.
The following PRS are a POC: https://github.com/MinaProtocol/mina/pull/16212 https://github.com/MinaProtocol/mina/pull/16216
Test Plan Manual:
- Run 1 node that syncs to devnet
- Run second node with node 1 as a trusted peer
- Dump completed work after bootstrap
- Check if output differs from the older version
Unit Test:
- Idk if this is possible yet, but a unit test to bootstap that ingests some preconstructed list of completed work. Tbh i am not sure how useful this will, because we mainly care about the behavior over the network.