Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR refactors PRT-related code to use contract adapters (instead of direct contract bindings), improves context propagation for transaction signing, and tightens DB schema constraints for epoch/tournament integrity.
Changes:
- Introduces
TournamentAdapter/DaveConsensusAdapterplus anAdapterFactory(with a default implementation) and migrates PRT service logic to use these adapters. - Updates
auth.GetTransactOptsto accept acontext.Contextand updates all call sites accordingly. - Adds DB constraints (epoch bounds checks, tournament max_level constraint) and adjusts
application.idto use an identity column.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/repository/postgres/schema/migrations/000001_create_initial_schema.up.sql | Switches application PK to identity and adds new CHECK constraints for epoch/tournament validity. |
| internal/prt/util.go | Moves the unsafe hash-slice conversion helper into a shared util. |
| internal/prt/types.go | Expands adapter interfaces and adds AdapterFactory + consensus adapter types. |
| internal/prt/service.go | Adds AdapterFactory wiring and uses ctx-aware GetTransactOpts; improves cancellation behavior in Tick. |
| internal/prt/prt.go | Migrates PRT logic to use adapters; tracks epoch index per application; improves error/log messages. |
| internal/prt/itournament_adapter.go | Simplifies event retrieval via a generic helper; adds BondValue/JoinTournament adapter methods. |
| internal/prt/idaveconsensus_adapter.go | New adapter wrapping the IDaveConsensus binding. |
| internal/node/node.go | Refactors service creation to pre-count children and use a buffered channel. |
| internal/config/auth/auth.go | Makes transact opts creation context-aware (incl. AWS config/signing). |
| internal/claimer/service.go | Updates transact opts creation to pass ctx. |
| cmd/cartesi-rollups-cli/root/send/send.go | Updates transact opts creation to pass ctx. |
| cmd/cartesi-rollups-cli/root/execute/execute.go | Updates transact opts creation to pass ctx. |
| cmd/cartesi-rollups-cli/root/deploy/authority.go | Updates transact opts creation to pass ctx. |
| cmd/cartesi-rollups-cli/root/deploy/application.go | Updates transact opts creation to pass ctx. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
also add some comments and small fixes
c3ea6d9 to
c0eff2b
Compare
mpolitzer
approved these changes
Feb 20, 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.