Skip to content

Poll network rules check until all nodes converge#265

Merged
simonlechner merged 3 commits into
mainfrom
simon/network-rules-convergence
Jul 21, 2026
Merged

Poll network rules check until all nodes converge#265
simonlechner merged 3 commits into
mainfrom
simon/network-rules-convergence

Conversation

@simonlechner

Copy link
Copy Markdown
Contributor

The networkRules check took a single instantaneous snapshot of each node's applied rules. But a rules update applies per node at the epoch seal, and waitForEpoch only waits for one (random) node to advance, so immediately afterward a slower node can still report the pre-update rules.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

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 updates the networkRules checker to tolerate per-node lag in applying rule updates by polling until all active nodes converge (or a timeout is hit), addressing flakiness caused by epoch-seal timing differences across nodes.

Changes:

  • Add a default convergence timeout and polling loop to networkRules checks (instead of a single snapshot).
  • Factor the original check logic into checkOnce and repeatedly invoke it until success/timeout.
  • Add tests covering eventual convergence after lag and returning a mismatch after timeout.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
driver/checking/network_rules.go Adds timeout-bounded polling for convergence and introduces checkOnce.
driver/checking/network_rules_test.go Adds unit tests for convergence polling behavior and timeout behavior.

Comment thread driver/checking/network_rules.go
Comment thread driver/checking/network_rules.go Outdated
@simonlechner
simonlechner requested a review from LuisPH3 July 20, 2026 12:16
Comment thread driver/checking/network_rules.go Outdated
Comment thread driver/checking/network_rules.go Outdated
@simonlechner
simonlechner requested a review from LuisPH3 July 20, 2026 13:22
@simonlechner
simonlechner merged commit d077749 into main Jul 21, 2026
3 checks passed
@simonlechner
simonlechner deleted the simon/network-rules-convergence branch July 21, 2026 07:27
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