Skip to content

Avoid redundant fork choice lookups in attestation verification#9577

Open
macladson wants to merge 1 commit into
sigp:unstablefrom
macladson:dedupe-attestation-fork-choice-lookups
Open

Avoid redundant fork choice lookups in attestation verification#9577
macladson wants to merge 1 commit into
sigp:unstablefrom
macladson:dedupe-attestation-fork-choice-lookups

Conversation

@macladson

Copy link
Copy Markdown
Member

Issue Addressed

with_committee_cache / with_cached_shuffling already perform a fork choice
lookup internally to resolve the shuffling ID from the head block.

There are certain callers who take the fork choice read lock and look up the same block
immediately before calling it, which performs the lookup again.

Proposed Changes

Thread the pre-fetched block into the shuffling cache via new
with_committee_cache_for_block/with_cached_shuffling_for_block methods that takes the block instead of the
root, so we avoid the redundant lookup.

@macladson macladson added code-quality optimization Something to make Lighthouse run more efficiently. ready-for-review The code is ready for review labels Jul 6, 2026
@macladson macladson requested a review from michaelsproul July 6, 2026 11:31
@macladson macladson force-pushed the dedupe-attestation-fork-choice-lookups branch from a8aaf12 to 9307ddb Compare July 10, 2026 11:42
@mergify

mergify Bot commented Jul 10, 2026

Copy link
Copy Markdown

Some required checks have failed. Could you please take a look @macladson? 🙏

@mergify mergify Bot added waiting-on-author The reviewer has suggested changes and awaits thier implementation. ready-for-review The code is ready for review and removed ready-for-review The code is ready for review waiting-on-author The reviewer has suggested changes and awaits thier implementation. labels Jul 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

code-quality optimization Something to make Lighthouse run more efficiently. ready-for-review The code is ready for review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant