Skip to content

Comments

Small PRT related refactors#739

Merged
vfusco merged 8 commits intonext/2.0from
feature/tournament-open-status
Feb 20, 2026
Merged

Small PRT related refactors#739
vfusco merged 8 commits intonext/2.0from
feature/tournament-open-status

Conversation

@vfusco
Copy link
Collaborator

@vfusco vfusco commented Feb 20, 2026

No description provided.

@vfusco vfusco added this to the 2.0.0 milestone Feb 20, 2026
@vfusco vfusco requested a review from Copilot February 20, 2026 16:59
@vfusco vfusco added this to Node Unit Feb 20, 2026
@vfusco vfusco self-assigned this Feb 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 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/DaveConsensusAdapter plus an AdapterFactory (with a default implementation) and migrates PRT service logic to use these adapters.
  • Updates auth.GetTransactOpts to accept a context.Context and updates all call sites accordingly.
  • Adds DB constraints (epoch bounds checks, tournament max_level constraint) and adjusts application.id to 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.

@vfusco vfusco requested a review from mpolitzer February 20, 2026 17:17
@vfusco vfusco force-pushed the feature/tournament-open-status branch from c3ea6d9 to c0eff2b Compare February 20, 2026 18:26
@vfusco vfusco merged commit c0eff2b into next/2.0 Feb 20, 2026
6 checks passed
@vfusco vfusco deleted the feature/tournament-open-status branch February 20, 2026 19:52
@github-project-automation github-project-automation bot moved this to ✅ Done in Node Unit Feb 20, 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.

2 participants