goshimmer
goshimmer copied to clipboard
TSC implementation using heap
Implement TSC condition check using a time heap. In this approach all unconfirmed blocks would be stored in a heap, where oldest blocks are be at the top of the heap. Each time an acceptance time is updated, an event is triggered which checks the oldest (unconfirmed) blocks in the heap and marks them and their entire future cone (which also is unconfirmed) as orphaned, removes the orpaned messages from the tip pool and scheduler.
Blocks are added to the heap upon solidification only when a node is bootstrapped (?) this needs more thought.
Currently TSC condition is evaluated during tip selection and it's hard to know when a message should be considered as orphaned (past cone walk would be necessary), but with the new approach we start from the first orphaned message and walk its future cone, which should be more effective.