Skip to content

PostElectra - call attestationData once #9618

@tbenr

Description

@tbenr

https://ethereum.github.io/beacon-APIs/#/Validator/produceAttestationData

there is no point in calling the api for each validators in the same committee anymore.

We can call it once for all validators now.

this only affects VC running A LOT of validators (multiple validators attesting on multiple committees)

private Stream<SafeFuture<ProductionResult<Attestation>>> produceAllAttestations(
final UInt64 slot,
final ForkInfo forkInfo,
final Int2ObjectMap<ScheduledCommittee> validatorsByCommitteeIndex) {
return validatorsByCommitteeIndex.int2ObjectEntrySet().stream()
.flatMap(
entry ->
produceAttestationsForCommittee(slot, forkInfo, entry.getIntKey(), entry.getValue())
.stream());
}
private List<SafeFuture<ProductionResult<Attestation>>> produceAttestationsForCommittee(
final UInt64 slot,
final ForkInfo forkInfo,
final int committeeIndex,
final ScheduledCommittee committee) {
final SafeFuture<Optional<AttestationData>> unsignedAttestationFuture =
validatorDutyMetrics.record(
() -> validatorApiChannel.createAttestationData(slot, committeeIndex),
this,
CREATE_TOTAL);
unsignedAttestationFuture.propagateTo(committee.getAttestationDataFuture());

currently on VC running 20k validators we have bursts of 50-60 createAttestationData calls at the same moment.

we should also rise a beacon-API pr to clarify that post-Electra the API can be used this way (calling it once with committe_index = 0) so BNs must not expect the api to be called with the actual committee index.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions