Skip to content

fix: orhphaned jobs indexing - #73

Merged
cristibleotiu merged 1 commit into
mainfrom
develop
Jul 13, 2026
Merged

fix: orhphaned jobs indexing#73
cristibleotiu merged 1 commit into
mainfrom
develop

Conversation

@aledefra

Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI review requested due to automatic review settings July 13, 2026 10:25
@aledefra
aledefra enabled auto-merge July 13, 2026 10:25
@aledefra
aledefra disabled auto-merge July 13, 2026 10:26

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 addresses allocation “orphaning”/duplicate indexing issues by persisting Ethereum log index on allocation events, deduplicating inserts using a partial unique index, and applying a targeted owner override for a known set of orphaned allocation transactions.

Changes:

  • Persist LogIndex on decoded allocation logs and add a partial unique index on (tx_hash, log_index) to prevent duplicate inserts when log index is available.
  • Adjust stats sync range to start from LastBlockNumber + 1 to avoid reprocessing the previously processed block.
  • Add a deterministic owner override for a known set of orphaned allocation transactions/nodes, with unit tests covering the override logic and log index persistence.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
storage/allocationStorer.go Adds ON CONFLICT DO NOTHING insert behavior for allocations keyed by (tx_hash, log_index) when log_index is present.
storage/allocationStorer_test.go Updates allocation fixtures to populate LogIndex to align with new schema expectations.
service/statsService.go Skips reprocessing last processed block; adds orphaned-allocation owner override; persists LogIndex from chain logs.
service/statsService_test.go Adds unit tests for orphaned owner override and for decodeAllocLogs persisting LogIndex.
scripts/infuraFunctions.go Persists LogIndex in script-side allocation log decoding.
model/poaiEvents.go Adds LogIndex field and a partial composite unique index on (tx_hash, log_index) where log_index IS NOT NULL.

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

Comment thread storage/allocationStorer.go
@cristibleotiu
cristibleotiu merged commit 98c3fff into main Jul 13, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants