Skip to content

Conversation

@StephenButtolph
Copy link
Contributor

Why this should be merged

This fixes a testing helper used in the proposervm.

How this works

MinDelayForProposer returns the delay on top of the parent timestamp. Because of this, the returned delay is guaranteed to increase between loop iterations. This means that if the loop ever loops, it will keep looping. ➿

How this was tested

n/a

Need to be documented in RELEASES.md?

@Copilot Copilot AI review requested due to automatic review settings September 23, 2025 15:53
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

This PR fixes a bug in the waitForProposerWindow testing helper function in the proposervm that was causing an infinite loop. The fix addresses the incorrect loop termination condition and improves the clock advancement logic.

  • Corrected the loop termination condition from checking delay against MaxLookAheadWindow to checking if current time has passed the required delay time
  • Fixed clock advancement to occur after the termination check instead of before
  • Added intermediate variable delayUntil for clearer time calculations

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@StephenButtolph StephenButtolph added this pull request to the merge queue Sep 23, 2025
Merged via the queue into master with commit 4969586 Sep 23, 2025
35 checks passed
@StephenButtolph StephenButtolph deleted the fix-wait-for-proposer-window branch September 23, 2025 17:07
@github-project-automation github-project-automation bot moved this to Done 🎉 in avalanchego Sep 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants