Skip to content

fix(vc): skip produceAttestationData when no attester duties - #8962

Open
b0a7 wants to merge 2 commits into
status-im:unstablefrom
b0a7:fix/vc-skip-empty-attestation-duties
Open

fix(vc): skip produceAttestationData when no attester duties#8962
b0a7 wants to merge 2 commits into
status-im:unstablefrom
b0a7:fix/vc-skip-empty-attestation-duties

Conversation

@b0a7

@b0a7 b0a7 commented Aug 30, 2026

Copy link
Copy Markdown

Summary

  • Do not call produceAttestationData (or wait for attestation-due) when the slot has no attester duties.
  • Matches Lodestar, Teku, Lighthouse, and Prysm, and matches the honest-validator spec (attest on the assigned slot only).
  • Stops idle-slot BN/middleware timeouts and “Beacon node down” log spam.
    Lighthouse hit the same every-slot fetch after an Electra refactor and fixed it in sigp/lighthouse#8559 (“Do not request attestation data when attestation duty is empty”).

Problem

The attestation service runs every slot. With no attester duty it still waited until attestation-due and called GET /eth/v1/validator/attestation_data. That is not required by the spec: a validator attests once per epoch on the slot from get_committee_assignment, which returns None when there is no assignment (phase0 honest validator — Attesting).
Against a local BN this is wasted traffic. Against Obol Charon the endpoint blocks on DutyDB until the cluster has attestation data for a real duty, so an idle slot never returns. The VC then times out and flaps the node:
Against a local BN this is wasted traffic. Against Obol Charon the endpoint blocks on DutyDB until the cluster has attestation data for a real duty, so an idle slot never returns. The VC then times out and marks the beacon node down (it is logged online again shortly after):

t+0.000s  INF  Slot start        node_status=synced delay=~2ms
t+7.5s    WRN  Beacon node down  reason="Timeout exceeded … produceAttestationData(best)"
t+7.5s    WRN  Unable to proceed attestations  duties_count=0  service=attestation_service

duties_count=0 means no attester duty this slot (Slot start also shows attestationIn many minutes away). On a duty slot the same path publishes normally (~50ms after attestation-due).

Approach

In spawnAttestationTasksV2, return immediately when getAttesterDutiesForSlot is empty.

Test plan

  • Unit tests in tests/test_validator_client.nim for getAttesterDutiesForSlot: empty map, duty on another slot, duty on the requested slot
  • CI unit suite / test_validator_client

AI assistance disclosure

I used Cursor to help inspect the Nimbus VC attestation loop, compare other clients and the honest-validator spec, draft this patch, and prepare this PR text. I reviewed the resulting diff and can explain the change. A human author remains responsible for the submitted code (see Status/Logos contributor guidance on AI-assisted work: allowed for drafting; the opener must review, verify, and be able to explain every change; PRs should not be opened automatically by an agent/bot). I am a node operator rather than a regular Nimbus contributor; corrections from maintainers are welcome.

@b0a7
b0a7 marked this pull request as ready for review August 30, 2026 03:52
@tersec

tersec commented Aug 30, 2026

Copy link
Copy Markdown
Contributor
The following files do not have an up-to-date copyright year:
- tests/test_validator_client.nim

i.e.

# Copyright (c) 2018-2025 Status Research & Development GmbH
should read 2018-2026

@github-actions

github-actions Bot commented Aug 30, 2026

Copy link
Copy Markdown

Unit Test Results

       12 files  ±0    2 888 suites  ±0   1h 7m 46s ⏱️ + 3m 1s
11 461 tests +1    8 269 ✔️ +1  3 192 💤 ±0  0 ±0 
57 200 runs  +4  51 373 ✔️ +4  5 827 💤 ±0  0 ±0 

Results for commit 8baaafa. ± Comparison against base commit 0726147.

♻️ This comment has been updated with latest results.

b0a7 and others added 2 commits August 30, 2026 08:23
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@b0a7
b0a7 force-pushed the fix/vc-skip-empty-attestation-duties branch from 17ed2f0 to 8baaafa Compare August 30, 2026 12:23
@b0a7

b0a7 commented Aug 30, 2026

Copy link
Copy Markdown
Author
The following files do not have an up-to-date copyright year:
- tests/test_validator_client.nim

i.e.

# Copyright (c) 2018-2025 Status Research & Development GmbH

should read 2018-2026

Thx, fixed

@tersec

tersec commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Against Obol Charon the endpoint blocks on DutyDB until the cluster has attestation data for a real duty, so an idle slot never returns.

This seems questionable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants