-
Notifications
You must be signed in to change notification settings - Fork 29
Implement blocktree data structure #30
Comments
Rather than root the tree from genesis, don't we want to root it to the most recent succinct state? |
Prune should be called whenever a new block extends a chain 290 blocks beyond the (succinct) |
Probably also want a method for looking up a block with a given hash. |
@jspada yes exactly, I just meant when we initialize the node it starts at genesis. when it syncs, the root of the blocktree will be moved along to the succint root that's 290 blocks behind the highest block like you mentioned. I don't think we'd need to unprune, as past 290 blocks the state should be considered probabilistically finalized, but we can double check. |
Task summary
implement blocktree data structure which tracks the different forks of the network in a tree structure starting from a root node (genesis) and branching out. the nodes should be of type
ProtocolState
and each node should have only 1 parent (its parent block), but each node can have any number of childrenAPI needed for blocktree:
Specification reference
Other information and links
found this package, might be handy: https://docs.rs/crate/trees/0.4.2 or feel free to use any other tree package that implements what we need
The text was updated successfully, but these errors were encountered: