Skip to content

@evanlinjin's Initial Review #2

@evanlinjin

Description

@evanlinjin

Thanks for this work and for providing a README that explains the design and rationale.

Some initial questions:

  1. What was the reason for moving away from CheckPoints? Was it to allow forward iteration and block lookups by hash?
  2. 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

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions