Skip to content

Fix bugs found on restart tests: advancer snapshot sync, claimer and prt in flight transactions#764

Merged
vfusco merged 8 commits intonext/2.0from
fix/advancer-snapshot-sync
Mar 23, 2026
Merged

Fix bugs found on restart tests: advancer snapshot sync, claimer and prt in flight transactions#764
vfusco merged 8 commits intonext/2.0from
fix/advancer-snapshot-sync

Conversation

@vfusco
Copy link
Collaborator

@vfusco vfusco commented Mar 20, 2026

No description provided.

@vfusco vfusco added this to the 2.0.0 milestone Mar 20, 2026
@vfusco vfusco self-assigned this Mar 20, 2026
Copy link

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 hardens restart-related behavior across the node’s synchronization/settlement/claiming flows and updates the integration test harness to manage the node lifecycle directly from TestMain, enabling restart/snapshot-policy coverage in a consistent way.

Changes:

  • Add end-to-end integration suites for node restart scenarios and snapshot policy behavior (Authority + PRT), including test-managed node restarts.
  • Improve robustness of PRT settlement/tournament join and Claimer behavior around “already submitted/joined/settled” cases after restart (lost in-memory “in-flight” maps).
  • Adjust machine synchronization logic to avoid false mismatches when DB pagination returns 0 rows at high offsets; update compose/test scripts to match the new test-managed node lifecycle.

Reviewed changes

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

Show a summary per file
File Description
test/integration/snapshot_policy_test.go New suite to validate snapshot loading across restarts under different snapshot policies (Authority + PRT).
test/integration/restart_test.go New suite to validate multi-app processing continuity across node restart (Authority + PRT).
test/integration/node_helpers_test.go Introduces shared node subprocess management helpers (start/stop/health).
test/integration/main_test.go Moves node lifecycle management into TestMain and sets up temp log/snapshots paths.
test/compose/compose.integration.yaml Removes compose-managed node service; relies on TestMain-managed node inside test container.
scripts/run-integration-tests.sh Simplifies entrypoint (node now started by TestMain) and prints node log on exit.
pkg/machine/implementation_test.go Stabilizes deadline-exceeded context test by using an already-expired deadline.
internal/prt/util.go Adds ABI-based revert-reason decoding helper for Error(string) revert payloads.
internal/prt/util_test.go Adds unit tests for revert-reason decoding helper.
internal/prt/types.go Adds constants used for PRT revert-reason handling.
internal/prt/prt.go Adds on-chain pre-checks + revert-based fallbacks for duplicate settle/join after restart.
internal/prt/itournament_adapter.go Adds adapter method to detect already-joined commitments on-chain.
internal/prt/idaveconsensus_adapter.go Adds adapter method to detect already-settled epochs (per current approach).
internal/manager/instance.go Moves processed-input validation earlier to avoid OFFSET/COUNT window-function edge case.
internal/manager/instance_test.go Updates mock behavior and expected error message to match PostgreSQL semantics and new error text.
internal/claimer/claimer.go Handles NotFirstClaim gracefully after restart; adds helper for epoch-only matching.
internal/claimer/blockchain.go Broadens ClaimAccepted event scan to match epoch identity (app + lastBlock) even if root differs (Quorum outvoting detection).
internal/claimer/claimer_test.go Adds coverage for NotFirstClaim handling (Authority benign vs Quorum inoperable).
Makefile Simplifies local integration flow (no longer starts node in Makefile) and kills stale node on port 10000.
Dockerfile Ensures log directory exists/owned correctly for named volume pre-population in tester image.

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

@vfusco vfusco force-pushed the fix/advancer-snapshot-sync branch 2 times, most recently from 7bde3d5 to 33c73a6 Compare March 23, 2026 14:17
@vfusco vfusco force-pushed the fix/advancer-snapshot-sync branch from 33c73a6 to dc91e3e Compare March 23, 2026 14:20
@vfusco vfusco force-pushed the fix/advancer-snapshot-sync branch from dc91e3e to c0094d6 Compare March 23, 2026 14:36
@vfusco vfusco marked this pull request as ready for review March 23, 2026 15:06
@github-project-automation github-project-automation bot moved this from Todo to Waiting Merge in Rollups SDK Mar 23, 2026
@vfusco vfusco merged commit fb12513 into next/2.0 Mar 23, 2026
8 checks passed
@vfusco vfusco deleted the fix/advancer-snapshot-sync branch March 23, 2026 22:42
@github-project-automation github-project-automation bot moved this from Waiting Merge to Done in Rollups SDK Mar 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants