Skip to content

Store non-finalized/live chain in a tree structure #85

@MegaRedHand

Description

@MegaRedHand

Currently, we just have a (slot, root) -> parent index stored in the database. We should instead keep this information in an in-memory tree for easier traversal. This also enables weight caching for head and safe target computation.

For reference, Lighthouse uses a "proto-array" implementation: https://github.com/sigp/lighthouse/tree/stable/consensus/proto_array/src
while Prysm uses a doubly-linked tree: https://github.com/OffchainLabs/prysm/tree/develop/beacon-chain/forkchoice/doubly-linked-tree

On a second version, we can add a DB fallback for long periods of non-finalization.

Related to #84

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions