Skip to content

refactor(duties_tracker): retain proposer-duty v2 response metadata - #1241

Merged
mergify[bot] merged 1 commit into
sigp:epbsfrom
petarjuki7:refactor/proposer-duty-v2-metadata
Aug 12, 2026
Merged

refactor(duties_tracker): retain proposer-duty v2 response metadata#1241
mergify[bot] merged 1 commit into
sigp:epbsfrom
petarjuki7:refactor/proposer-duty-v2-metadata

Conversation

@petarjuki7

Copy link
Copy Markdown
Member

Problem, Evidence, and Context

Change Overview

  • New ProposerSchedule type with private fields, built only through from_response, which accepts a response only if it has exactly SLOTS_PER_EPOCH duties, all inside the requested epoch, each slot exactly once. Anything else is rejected with a typed error naming the defect.
  • The poll switches to get_validator_duties_proposer_v2 and stores the validated schedule together with dependent_root and execution_optimistic. Neither field affects whether a schedule is accepted; they are retained for refresh decisions and diagnostics (fix(duties_tracker): authoritative complete-schedule transitions for proposer assignment verdicts #1184).
  • A failed or malformed refresh leaves the previously stored schedule in place; an epoch with no prior schedule stays absent.
  • Intentionally unchanged: the DutiesProvider trait and DutyAssignment semantics, per-epoch insert ordering, current+next polling, retention pruning, and no filtering by the local registry.

Risks, Trade-offs, and Mitigations

  • Scope is proposer-duty storage in this crate; dependent crates compile unchanged.
  • Behavior change: malformed responses no longer replace a stored view. This is the intended SIP-101 behavior, not a regression.
  • Requires the beacon node to serve /eth/v2/validator/duties/proposer; the pinned Lighthouse does.

Validation

  • Unit tests cover the acceptance matrix: complete out-of-order schedule accepted, metadata retained verbatim, and wrong-length, empty, out-of-epoch, and duplicate-slot responses rejected with the exact error. With the length pinned at SLOTS_PER_EPOCH and every slot in range, a missing slot can only appear as a duplicate, so that case covers both.
  • cargo +nightly fmt --check, clippy --all-targets -D warnings, and cargo test -p duties_tracker (11 tests) pass.

Rollback

  • Revert the commit. No config, data, or operational impact.

Blockers / Dependencies

Additional Info / Next Steps

Fetch proposer duties from the v2 endpoint and store each epoch's
response as a ProposerSchedule: the duties plus dependent_root and
execution_optimistic. A response is stored only if it validates as a
complete schedule (one duty per slot of the requested epoch); a failed
or malformed refresh keeps the previously stored schedule.

Closes sigp#1183
@petarjuki7 petarjuki7 self-assigned this Aug 11, 2026
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.28859% with 10 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (epbs@7ec3a06). Learn more about missing BASE report.

Files with missing lines Patch % Lines
anchor/duties_tracker/src/duties_tracker.rs 90.19% 10 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             epbs    #1241   +/-   ##
=======================================
  Coverage        ?   73.13%           
=======================================
  Files           ?      170           
  Lines           ?    34495           
  Branches        ?        0           
=======================================
  Hits            ?    25227           
  Misses          ?     9268           
  Partials        ?        0           
Flag Coverage Δ
rust 73.13% <93.28%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@shane-moore shane-moore left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

very nice!

@mergify

mergify Bot commented Aug 12, 2026

Copy link
Copy Markdown

Queued — the merge queue status continues in this comment ↓.

@mergify

mergify Bot commented Aug 12, 2026

Copy link
Copy Markdown

Merge Queue Status

This pull request spent 28 minutes 42 seconds in the queue, including 26 minutes 44 seconds running CI.

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

@mergify mergify Bot added the queued label Aug 12, 2026
@mergify
mergify Bot merged commit f41c1c1 into sigp:epbs Aug 12, 2026
23 checks passed
@mergify mergify Bot removed the queued label Aug 12, 2026
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.

3 participants