Skip to content

Expensive fork-choice queued attestation mutation #6206

@dapplion

Description

@dapplion

Description

Debugging a Holesky node we noted that the split_off here was moving ~1 GB of data every time we process an attestation

let remaining = queued_attestations.split_off(

Questions:

  1. Why did the queued attestations Vec grow so large?
  2. Why is it being mutated every call?
  3. Do we have to use a Vec for this?

Tackling 2 and 3, we could switch to a HashMap<Slot, Vec<QueuedAttestation>> as time strictly advances forward, so each slot Vec is strictly append-only.

WIP of this approach: https://github.com/sigp/lighthouse/compare/stable...dapplion:lighthouse:fork-choice-queued-attestations?expand=1

However we should answer 1 too as there may be some other lingering issue

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingoptimizationSomething to make Lighthouse run more efficiently.v5.3.0Q3 2024 release with database changes!

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions