Conversation
There was a problem hiding this comment.
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.
7bde3d5 to
33c73a6
Compare
33c73a6 to
dc91e3e
Compare
…ents on epoch identity
dc91e3e to
c0094d6
Compare
renatomaia
approved these changes
Mar 23, 2026
mpolitzer
approved these changes
Mar 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.