Skip to content

Conversation

@chong-he
Copy link
Member

@chong-he chong-he commented Oct 8, 2025

Issue Addressed

Proposed Changes

Split the function publish_attestations_and_aggregates into publish_attestations and handle_aggregates, so that for attestations, only 1 task is spawned.

Additional Info

Tested with Kurtosis on minimal preset, which has a max_committees_per_slot of 4. The number of times the VC calls the BN for the endpoint /eth/v1/validator/attestation_data is given by the metric: http_api_paths_times_count{path="v1/validator/attestation_data"}

For 100 slots of data:
Before: http_api_paths_times_count{path="v1/validator/attestation_data"} 398
After: http_api_paths_times_count{path="v1/validator/attestation_data"} 100

From the test output, we see that the number of calls to the BN is reduced. On mainnet, the max_committee_per_slot is 64, the VC should only call the BN only once per slot for this endpoint

@chong-he chong-he changed the title attestation committee index Always use committee index 0 when getting attestation data Oct 8, 2025
@chong-he chong-he added the work-in-progress PR is a work-in-progress label Oct 8, 2025
@michaelsproul michaelsproul added val-client Relates to the validator client binary optimization Something to make Lighthouse run more efficiently. v8.1.0 Post-Fulu release labels Oct 16, 2025
@chong-he chong-he added ready-for-review The code is ready for review and removed work-in-progress PR is a work-in-progress labels Oct 17, 2025
@mergify
Copy link

mergify bot commented Oct 20, 2025

Some required checks have failed. Could you please take a look @chong-he? 🙏

@mergify mergify bot added waiting-on-author The reviewer has suggested changes and awaits thier implementation. and removed ready-for-review The code is ready for review labels Oct 20, 2025
@chong-he chong-he added ready-for-review The code is ready for review and removed waiting-on-author The reviewer has suggested changes and awaits thier implementation. labels Oct 20, 2025
@dapplion
Copy link
Collaborator

This feature conflicted in the past with DVT setups which rely on the committee index. Is that not the case anymore after Electra?

@chong-he
Copy link
Member Author

This feature conflicted in the past with DVT setups which rely on the committee index. Is that not the case anymore after Electra?

Not sure which issue are you referring to about the DVT conflict?

For post-Electra, when VC requests to the BN, it must have a committee_index of 0:
https://ethereum.github.io/beacon-APIs/?urls.primaryName=dev#/Validator/produceAttestationData

@KaloyanTanev
Copy link

KaloyanTanev commented Oct 27, 2025

@dapplion I can speak of Charon here. We did have conflicts indeed, but it was fixed in v1.4.3 (~5 months ago), a week after Electra fork.

Edit: To be precise, we had issues when a DV cluster had mix of VCs, some asking for attestation data with committee index 0, while others for the actual committee index.

@michaelsproul michaelsproul added the electra Required for the Electra/Prague fork label Nov 4, 2025
Copy link
Member

@macladson macladson left a comment

Choose a reason for hiding this comment

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

Do we have to handle attestations pre-Electra as well? Seems like we would only request committee 0 even pre-Electra, but I could be misunderstanding the fork flow.

Note that this will spawn twice as many tasks (one for attestations, one for aggregates) but I actually think that in this case it will improve performance despite the context-switching overhead since these tasks are likely IO bound and so can yield quicker than before. (Plus of course the huge reduction in BN calls makes this significantly better of course)

@eserilev
Copy link
Member

Do we have to handle attestations pre-Electra as well? Seems like we would only request committee 0 even pre-Electra, but I could be misunderstanding the fork flow.

no we don't need to handle constructing pre-electra attestations. we actually removed a lot of pre-electra attestation logic when we moved to SingleAttestation

@michaelsproul
Copy link
Member

Seeing very high values for the vc_attestation_service_task_times{attestations_http_get} metric on Hoodi (like 4s+ for the 99th percentile, and 1.5-2s for the median). I think this PR could help speed that up a lot (by reducing the number of requests), so will prioritise review and merge.

@mergify
Copy link

mergify bot commented Dec 1, 2025

This pull request has merge conflicts. Could you please resolve them @chong-he? 🙏

@mergify mergify bot added waiting-on-author The reviewer has suggested changes and awaits thier implementation. and removed ready-for-review The code is ready for review labels Dec 1, 2025
@michaelsproul
Copy link
Member

This change did help a lot with reducing the time the VC needs to fetch attestations from the BN. Data taken from a Hoodi VC with 10k keys, connected to an overworked BN.

http-get-times

@michaelsproul michaelsproul added the backwards-incompat Backwards-incompatible API change label Dec 1, 2025
@michaelsproul
Copy link
Member

Marking this as backwards-incompat, as it will technically break pre-Electra devnets.

@mergify mergify bot added ready-for-review The code is ready for review and removed waiting-on-author The reviewer has suggested changes and awaits thier implementation. labels Dec 2, 2025
@mergify
Copy link

mergify bot commented Dec 2, 2025

Some required checks have failed. Could you please take a look @chong-he? 🙏

@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 Dec 2, 2025
Copy link
Member

@eserilev eserilev left a comment

Choose a reason for hiding this comment

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

Nice work, LGTM!!

@michaelsproul michaelsproul added ready-for-merge This PR is ready to merge. and removed ready-for-review The code is ready for review labels Dec 3, 2025
@mergify
Copy link

mergify bot commented Dec 3, 2025

Merge Queue Status Beta

✅ The pull request has been merged

This pull request spent 41 minutes 6 seconds in the queue, including 38 minutes 38 seconds running CI.
The checks were run on draft #8519.

Required conditions to merge
  • check-success=local-testnet-success
  • check-success=test-suite-success

@mergify mergify bot added the queued label Dec 3, 2025
mergify bot added a commit that referenced this pull request Dec 3, 2025
@mergify mergify bot merged commit 0bccc70 into sigp:unstable Dec 3, 2025
45 of 46 checks passed
@mergify mergify bot removed the queued label Dec 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backwards-incompat Backwards-incompatible API change electra Required for the Electra/Prague fork optimization Something to make Lighthouse run more efficiently. ready-for-merge This PR is ready to merge. v8.1.0 Post-Fulu release val-client Relates to the validator client binary

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants