stacks-core icon indicating copy to clipboard operation
stacks-core copied to clipboard

[Nakamoto] Block inventory sync network state machine

Open jcnelson opened this issue 1 year ago • 2 comments

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.

jcnelson avatar Nov 15 '23 17:11 jcnelson

  • 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

saralab avatar Nov 15 '23 17:11 saralab

The client logic is done, but not the state machine itself

jcnelson avatar Feb 05 '24 15:02 jcnelson