Skip to content

*: rework deadliner#4552

Merged
KaloyanTanev merged 4 commits into
mainfrom
kalo/rework-deadliner
Jun 8, 2026
Merged

*: rework deadliner#4552
KaloyanTanev merged 4 commits into
mainfrom
kalo/rework-deadliner

Conversation

@KaloyanTanev

Copy link
Copy Markdown
Collaborator

Previously deadliner has been using only true or false, if a duty was successfully scheduled for a deadline. We have scenarios where some duties never expire (e.g.: exits), that were returning false. Because of that, in some cases, this response from the deadliner was skipped.

This PR refactors the deadliner to return 3 statuses - scheduled, expired or exempt. The deadliner call .Add is refactored throughout the code to take into consideration the response. In the previous version it could've caused some issues at places like core/parsigdb/memory.go:StoreExternal, where we would add partial sigs to the DB, even if they were expired. Potentially storing them forever, as they were not added to the deadliner. Back in the days this was probably done in order to accommodate sigs for exits.

This PR also increases the time of the deadline of attestations and aggregations. This was done so it accommodates some potential mismatches in timings between VCs (especially for preapre_aggregator duties).

category: bug
ticket: none

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors the core.Deadliner API from a boolean return to a tri-state core.DeadlineStatus (scheduled, expired, exempt) and updates call sites to react appropriately (notably preventing storage of already-expired partial signatures). It also extends deadline durations for attestation/aggregation-related duties to better tolerate timing mismatches between validator clients.

Changes:

  • Introduce core.DeadlineStatus and update Deadliner.Add to return Expired|Scheduled|Exempt, propagating the new semantics across core components and mocks.
  • Prevent core/parsigdb.MemDB.StoreExternal from storing partial signatures for already-expired duties (which otherwise cannot be trimmed and would leak).
  • Increase deadlines for attester/aggregator duties to one epoch, and prepare duties to two epochs, updating unit tests accordingly.

Reviewed changes

Copilot reviewed 16 out of 17 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
dkg/exchanger.go Updates a no-op deadliner implementation to the new DeadlineStatus API.
core/tracker/tracker.go Adjusts tracker deadliner gating logic for tri-state statuses.
core/tracker/tracker_internal_test.go Updates tracker test deadliner to new return type.
core/priority/prioritiser.go Updates prioritiser deadliner checks and related error/log strings.
core/parsigdb/memory.go Drops externally received partial sigs for already-expired duties to avoid untrimmed leaks.
core/parsigdb/memory_internal_test.go Adds coverage ensuring StoreExternal drops expired duties but stores scheduled/exempt.
core/mocks/deadliner.go Regenerates/updates mock deadliner to return DeadlineStatus.
core/dutydb/memory.go Updates storage gating to use tri-state deadliner responses.
core/dutydb/memory_test.go Updates test deadliner to return DeadlineStatus.
core/dutydb/memory_internal_test.go Updates noop deadliner in internal test to return DeadlineStatus.
core/deadline.go Introduces DeadlineStatus, updates Deadliner contract and implementation, and increases duty deadline durations using slotsPerEpoch.
core/deadline_test.go Updates tests for tri-state return type and revised duty deadlines.
core/consensus/qbft/qbft.go Updates QBFT deadliner gating and messaging to tri-state.
core/consensus/qbft/qbft_test.go Updates mock expectations to return DeadlineScheduled.
core/consensus/qbft/qbft_internal_test.go Updates mock expectations to return DeadlineScheduled.
core/aggsigdb/memory_test.go Updates noop deadliner used by tests to return DeadlineStatus.
core/aggsigdb/memory_internal_test.go Updates test deadliner to return DeadlineStatus.
Files not reviewed (1)
  • core/mocks/deadliner.go: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread core/parsigdb/memory.go Outdated
Comment thread core/deadline_test.go
Comment thread dkg/exchanger.go
@codecov

codecov Bot commented Jun 8, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 78.16092% with 19 lines in your changes missing coverage. Please review.
✅ Project coverage is 57.08%. Comparing base (9a39a98) to head (cb274d3).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
core/consensus/qbft/qbft.go 0.00% 3 Missing and 2 partials ⚠️
core/parsigdb/memory.go 92.72% 2 Missing and 2 partials ⚠️
core/tracker/tracker.go 0.00% 2 Missing and 2 partials ⚠️
core/deadline.go 86.66% 2 Missing ⚠️
core/dutydb/memory.go 0.00% 1 Missing and 1 partial ⚠️
core/priority/prioritiser.go 50.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4552      +/-   ##
==========================================
+ Coverage   56.98%   57.08%   +0.09%     
==========================================
  Files         245      245              
  Lines       33150    33200      +50     
==========================================
+ Hits        18892    18951      +59     
+ Misses      11870    11858      -12     
- Partials     2388     2391       +3     

☔ 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.

@pinebit pinebit left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

as long as this passes the tests and copilot is happy, it looks good

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 16 out of 17 changed files in this pull request and generated 4 comments.

Files not reviewed (1)
  • core/mocks/deadliner.go: Language not supported

Comment thread core/parsigdb/memory.go Outdated
Comment thread core/parsigdb/memory.go
Comment thread core/deadline.go
Comment thread core/deadline.go
@sonarqubecloud

sonarqubecloud Bot commented Jun 8, 2026

Copy link
Copy Markdown

@KaloyanTanev KaloyanTanev enabled auto-merge (squash) June 8, 2026 16:30
@KaloyanTanev KaloyanTanev merged commit d81b3b8 into main Jun 8, 2026
9 of 10 checks passed
@KaloyanTanev KaloyanTanev deleted the kalo/rework-deadliner branch June 8, 2026 16:37
pinebit added a commit that referenced this pull request Jun 9, 2026
Cherry-picked:
* rework deadliner #4552
* core/validatorapi: fix dynamic path proxy metric #4553
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