-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Thanks for this work and for providing a README that explains the design and rationale.
Some initial questions:
- What was the reason for moving away from
CheckPoints? Was it to allow forward iteration and block lookups by hash? - Why is an explicit
reindex()required? Shouldn't it be possible to implement an algorithm that updates the data correctly without needing this?
Let me try to convince you why keeping CheckPoints is a good idea:
- Shallow-cloning is cheap and thread-safe — It's literally just a smart pointer increment. We can pass the entire chain to a chain source via a shallow clone to start sync without needing to lock the
BlockGraph. The non-linked-list alternative is to provide a segment of top blocks to the chain source; however, this forces the caller to decide how many blocks to include — a decision that’s error-prone (e.g., what if WW3 strikes and there’s a 100-block reorg?). - Backward iteration is cheap — It's a linked list.
- Height-based lookup can be made efficient — We can implement a skip list.
Metadata
Metadata
Assignees
Labels
No labels