Skip to content

feat(repository): claimer rework#763

Draft
mpolitzer wants to merge 1 commit intonext/2.0from
feature/claimer-new-implementation
Draft

feat(repository): claimer rework#763
mpolitzer wants to merge 1 commit intonext/2.0from
feature/claimer-new-implementation

Conversation

@mpolitzer
Copy link

No description provided.

@mpolitzer mpolitzer requested a review from Copilot March 19, 2026 12:42
@mpolitzer mpolitzer self-assigned this Mar 19, 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 reworks the “claimer” flow by removing the bespoke claimer repository APIs, extending the schema/model to track claim-submitted/claim-accepted tx hashes and per-app claim event scan checkpoints, and updating the claimer service to operate via the general-purpose repository interfaces.

Changes:

  • Remove ClaimerRepository and Postgres claimer queries; add new epoch repo update methods for claim tx hashes.
  • Extend application and epoch persistence/model with claim scan checkpoints and separate submitted/accepted claim tx hash fields.
  • Rewrite claimer tick logic to iterate enabled applications, scan claim events, update epoch status/tx hashes, and optionally submit claims.

Reviewed changes

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

Show a summary per file
File Description
internal/claimer/service.go Switch Tick() to new update flow using generic repo/client + configured default block
internal/claimer/claimer.go New claimer core logic: per-app epoch scanning, event collection, tx submission/confirmation
internal/claimer/blockchain.go Removed old claimer blockchain helper implementation
internal/repository/repository.go Remove ClaimerRepository; add epoch tx-hash update methods to EpochRepository
internal/repository/postgres/epoch.go Implement new tx-hash update methods; include new tx hash fields in ListEpochs
internal/repository/postgres/application.go Persist and map new application claim scan checkpoint columns
internal/repository/postgres/schema/migrations/000001_create_initial_schema.up.sql Add new columns for claim checkpoints and per-epoch tx hashes
internal/repository/postgres/db/rollupsdb/public/table/application.go Jet table updates for new application columns
internal/repository/postgres/db/rollupsdb/public/table/epoch.go Jet table updates for new epoch columns
internal/model/models.go Add model fields for claim checkpoints and separate submitted/accepted tx hashes
internal/repository/postgres/claimer.go Removed old Postgres claimer query/update implementation
internal/repository/repotest/claimer_test_cases.go Removed repository claimer test suite file
Comments suppressed due to low confidence (2)

internal/repository/repotest/claimer_test_cases.go:1

  • This file removal deletes the ClaimerSuite and helper builders, but internal/repository/repotest/repotest.go still invokes NewClaimerSuite. As-is, the repotest package will no longer compile. Either keep/move these claimer repository test cases (adapted to the new schema/API) or remove the Claimer suite registration from repotest.go.
    internal/repository/postgres/epoch.go:736
  • ListEpochs now selects/scans ClaimSubmittedTransactionHash and ClaimAcceptedTransactionHash, but other epoch fetch paths (e.g., GetEpoch / GetEpochByVirtualIndex) still only populate ClaimTransactionHash. This can lead to these new fields always being nil in API responses or callers that use GetEpoch. Consider updating the other SELECT/Scan projections for consistency with the expanded model.Epoch struct.
	sel := table.Epoch.
		SELECT(
			table.Epoch.ApplicationID,
			table.Epoch.Index,
			table.Epoch.FirstBlock,
			table.Epoch.LastBlock,
			table.Epoch.InputIndexLowerBound,
			table.Epoch.InputIndexUpperBound,
			table.Epoch.MachineHash,
			table.Epoch.OutputsMerkleRoot,
			table.Epoch.Commitment,
			table.Epoch.ClaimTransactionHash,
			table.Epoch.ClaimSubmittedTransactionHash,
			table.Epoch.ClaimAcceptedTransactionHash,
			table.Epoch.TournamentAddress,
			table.Epoch.Status,
			table.Epoch.VirtualIndex,
			table.Epoch.CreatedAt,
			table.Epoch.UpdatedAt,

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

Comment on lines +60 to +64
type iRepository interface {
repository.ApplicationRepository
repository.EpochRepository
repository.NodeConfigRepository
}
@mpolitzer mpolitzer force-pushed the feature/claimer-new-implementation branch 2 times, most recently from d363b3b to 8803ee9 Compare March 20, 2026 02:48
@mpolitzer mpolitzer force-pushed the feature/claimer-new-implementation branch from 8803ee9 to 031bf63 Compare March 20, 2026 03:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

2 participants