stacks-core
stacks-core copied to clipboard
[Nakamoto] Block inventory sync network state machine
There needs to be a Nakamoto-specific network state machine for synchronizing block inventories. Per the SIP, the inventory bit-vectors exchanged are framed by reward cycle, and there exists a 1-bit in the ith slot in the vector if there was a tenure-change in that sortition, and a 0-bit if not. As before, nodes need to synchronize the entirety of their neighbors' block inventory vectors on boot-up, and then only need to track the last two reward cycles' inventories when out of IBD. Unlike before, there is no need to separately synchronize the PoX bit vector since Nakamoto cannot fork.
- Limit the scope of this PR with tenurechange validation logic for easy review and testability
- N/w state machine and inventory logic is self contained
Task 1: Calculate local inventory vector , needs caching strategy like today - S Task 1.1: Bit vector Synchronization Task 1.2: Tenurechanges
Task 2: Create message types and validation - S Task 3: make the state machine - M
The client logic is done, but not the state machine itself