Skip to content

Conversation

michaelsproul
Copy link
Member

Proposed Changes

Avoid expensive block_root_at_slot call in status processing. This proved to be very time consuming on networks without finality, like Goerli.

@michaelsproul michaelsproul added work-in-progress PR is a work-in-progress optimization Something to make Lighthouse run more efficiently. labels Mar 26, 2024
} else {
// Peer's finality is older than ours, but newer than our split point, making a
// block root check infeasible. This case shouldn't happen particularly often so
// we give the peer the benefit of the doubt and let them connect to us.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAIU this can happen if pruning is lagging in our end? If finality is recent you can do a cheap check against the head state, else default to None

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, we can even choose to lag the split point using --epochs-per-migration

I'll add another case for if finality is recent

Copy link
Collaborator

@dapplion dapplion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a massive performance improvement for networks with high finality delay

@michaelsproul
Copy link
Member Author

Fixed already in:

@michaelsproul michaelsproul deleted the optimise-status-stable branch April 17, 2025 08:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
optimization Something to make Lighthouse run more efficiently. waiting-on-author The reviewer has suggested changes and awaits thier implementation.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants