Skip to content

fix(consensus): correct vote-seal delay window math#421

Open
blakebyrnes wants to merge 1 commit intomainfrom
pr/security-vote-seal-delay-window-fix
Open

fix(consensus): correct vote-seal delay window math#421
blakebyrnes wants to merge 1 commit intomainfrom
pr/security-vote-seal-delay-window-fix

Conversation

@blakebyrnes
Copy link
Contributor

Summary

Fix the vote-seal delay calculation so delayed miners are scheduled at the intended point within the current tick window.

Why

The existing delay logic could push delayed vote attempts later than intended once part of the tick had already elapsed.

Validation

  • cargo test -p argon-node-consensus --lib notebook_tick_checker

Copilot AI review requested due to automatic review settings March 9, 2026 15:19
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes vote-seal delay scheduling so miners are delayed to their intended percentile position within the current tick window, accounting for time already elapsed in the tick.

Changes:

  • Correct delay math by computing a remaining delay (target_offset - elapsed) rather than applying the full percentile offset from “now”.
  • Extract helper methods (remaining_delay_for_percentile, percentile_tick_offset) to make the delay calculation testable and clearer.
  • Replace a timing-flaky test with deterministic unit tests for the delay math.

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

Schedule delayed vote-seal attempts from the remaining time in the current tick window instead of reapplying the full percentile offset. Add deterministic coverage for partial-elapsed tick cases.
@blakebyrnes blakebyrnes force-pushed the pr/security-vote-seal-delay-window-fix branch from 60577b6 to 32ac45d Compare March 9, 2026 15:29
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