-
Notifications
You must be signed in to change notification settings - Fork 150
fix(runner): conclude benign ErrNoValidDutiesToExecute as not_required, not failed #2988
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: stage
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -379,6 +379,10 @@ listener: | |
| ) | ||
|
|
||
| if totalAttestations == 0 && totalSyncCommittee == 0 { | ||
| // Benign terminal: the committee decided but this operator ended up with zero valid duties to | ||
| // sign. Conclude as not_required so the watcher doesn't report a false "stuck"; the sentinel | ||
| // still tells committee_queue to drop the message and terminate the runner. | ||
| r.markDutyNotRequired() | ||
| return ErrNoValidDutiesToExecute | ||
| } | ||
|
|
||
|
|
@@ -514,6 +518,9 @@ func (r *CommitteeRunner) ProcessPostConsensus(ctx context.Context, logger *zap. | |
| // are tagged recoverableReconstructError and must not be recorded as failed. | ||
| // Shutdown (context cancellation) needs no special-casing — markDutyFailed drops a context.Canceled | ||
| // reason, so a submission aborted by shutdown isn't recorded as a failure. | ||
| // The benign no-beacon-objects sentinel (ErrNoValidDutiesToExecute) pre-concludes the duty as | ||
| // not_required before returning, which makes this deferred markDutyFailed a no-op (concludeDuty | ||
| // is idempotent) — it must not be recorded as failed either. | ||
| defer func() { | ||
| if err != nil && !isRecoverableReconstructError(err) { | ||
| r.markDutyFailed(err) | ||
|
|
@@ -529,6 +536,12 @@ func (r *CommitteeRunner) ProcessPostConsensus(ctx context.Context, logger *zap. | |
| return fmt.Errorf("could not get expected post consensus roots and beacon objects: %w", err) | ||
| } | ||
| if len(beaconObjects) == 0 { | ||
| // Benign terminal: the committee reached consensus but this operator has no beacon objects to | ||
| // submit (e.g. divergent validator sets across the committee's operators). Conclude as | ||
| // not_required — not failed — before returning the sentinel; concludeDuty is idempotent, so | ||
| // the deferred markDutyFailed becomes a no-op. The sentinel still tells committee_queue to | ||
| // drop the message and terminate the runner. | ||
| r.markDutyNotRequired() | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Building on the existing P1 by Greptile from above (empty objects masking construction failures) rather than repeating it — two clarifications that should help decide the fix: A template already exists in the sibling runner. Severity is likely below P1 in practice. Scope note: only this post-consensus branch is affected. The consensus-phase sibling change at L381-L387 is unambiguous — |
||
| return ErrNoValidDutiesToExecute | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When every validator is skipped because duty validation, object construction, domain-data retrieval, or signing-root computation fails, this branch records the empty result as successful
not_required, suppressing the failed outcome and warning for a missed submission.Knowledge Base Used: Protocol v2 Duty Runners and QBFT Consensus
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!