Skip to content

Conversation

@fbac
Copy link
Collaborator

@fbac fbac commented Oct 7, 2025

Log PayerReportSubmitted events only on successful storage in pkg/indexer/settlement_chain/contracts/PayerReportManagerStorer.StoreLog

The handler for PayerReportSubmitted events in pkg/indexer/settlement_chain/contracts/payer_report_manager_storer.go now logs success only when storage succeeds and treats zero-row inserts as an existing report condition. The IPayerReportStore.StoreReport signature changes to return the number of affected rows and an error, and Store.StoreReport returns (int64, error) from the underlying insert operation.

  • Update PayerReportManagerStorer.StoreLog to conditionally log success on nil error and suppress errors tagged with ErrReportAlreadyExists in payer_report_manager_storer.go
  • Add ErrReportAlreadyExists and adjust PayerReportManagerStorer.setReportSubmitted to use (numRows, error) from store.StoreReport, returning a non-recoverable error when numRows == 0, and calling SetReportSubmitted only on new inserts in payer_report_manager_storer.go
  • Change IPayerReportStore.StoreReport to return (int64, error) in interface.go
  • Modify Store.StoreReport to return (int64, error) and propagate affected row count in store.go

📍Where to Start

Start with the PayerReportManagerStorer.StoreLog handler in payer_report_manager_storer.go, then review PayerReportManagerStorer.setReportSubmitted to see how (numRows, error) is used and how ErrReportAlreadyExists is handled.

Changes since #1217 opened

  • Modified IPayerReportStore.StoreReport method signature to return (int64, error) instead of just error [9ea929f]
  • Updated all StoreReport method calls in tests to capture and assert the new int64 return value [9ea929f]
  • Modified execution order in contracts.PayerReportManagerStorer.setReportSubmitted method to call store operation before error handling [33c55df]

Macroscope summarized 33c55df.

@fbac fbac requested a review from a team as a code owner October 7, 2025 15:02
@graphite-app
Copy link

graphite-app bot commented Oct 7, 2025

How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • Queue - adds this PR to the back of the merge queue
  • Hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

@fbac fbac force-pushed the 10-07-payer_report_manager_log branch from 57f8fef to 0e52a3f Compare October 7, 2025 15:05
@mkysel mkysel self-requested a review October 7, 2025 15:30
@fbac fbac merged commit 7c69cc0 into main Oct 7, 2025
11 checks passed
@fbac fbac deleted the 10-07-payer_report_manager_log branch October 7, 2025 20:09
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