Skip to content

Conversation

@fbac
Copy link
Collaborator

@fbac fbac commented Oct 9, 2025

Classify and mark payer reports as SubmissionRejected when on-chain submission fails with invalid sequence IDs in pkg/payerreport/workers/submitter.go

This change introduces invalid-sequence error inspection via blockchain.ProtocolError, updates report submission flows to return and handle protocol errors, and adds a rejected submission status that the submitter worker applies when an on-chain revert indicates invalid sequence IDs. It renames ErrInvalidSequenceIds to ErrInvalidSequenceIDs and maps protocol code 0xa7ee0517 to the new name. It adds SubmissionRejected with value 3 and updates the submitter to set this status on matching errors.

  • Extend blockchain.ProtocolError with Unwrap() and IsErrInvalidSequenceIDs() and adjust BlockchainError checks in errors.go
  • Change SubmitPayerReport to return blockchain.ProtocolError in interface.go and update the implementation in payer_report_manager.go
  • Add SubmissionRejected status and store transition API in report.go and store.go, and define SetReportSubmissionRejected in interface.go
  • Handle invalid sequence ID errors and mark reports rejected in submitter.go, and validate via integration test in integration_test.go

📍Where to Start

Start with the worker flow in payerreport.workers.SubmitterWorker.SubmitReports in submitter.go, then review the error type changes in errors.go and the interface return type update in interface.go.


Changes since #1234 opened

  • Restructured error handling in payerreport.workers.SubmitterWorker.SubmitReports method for submission rejections based on invalid sequence IDs [a486539]
  • Added mock support for SetReportSubmissionRejected method in payerreport package mocks [a486539]

📊 Macroscope summarized a486539. 2 files reviewed, 1 issues evaluated, 1 issues filtered, 0 comments posted

🗂️ Filtered Issues

pkg/payerreport/workers/submitter.go — 0 comments posted, 1 evaluated, 1 filtered
  • line 106: SubmitReports treats any non-nil ProtocolError from submitReport as a failure unless it is IsErrInvalidSequenceIDs(). The ProtocolError interface explicitly exposes IsNoChange(), which is commonly used to indicate an idempotent or already-applied condition that should not be considered an error. By not handling IsNoChange() separately, the worker will log an error and propagate latestErr even in benign/no-op cases (e.g., already submitted), potentially causing unnecessary retries and masking a successful state. This is a runtime behavior bug introduced by changing the blockchain submission API to return ProtocolError with richer semantics without updating the consumer logic to preserve contract parity. The fix is to check submitErr.IsNoChange() and either skip error propagation (and optionally call SetReportSubmitted) or log at a lower level without treating it as a failure. [ Low confidence ]

@fbac fbac requested a review from a team as a code owner October 9, 2025 17:34
@graphite-app
Copy link

graphite-app bot commented Oct 9, 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 merged commit e8b8c0b into main Oct 9, 2025
11 checks passed
@fbac fbac deleted the 10-09-add_submission_rejected branch October 9, 2025 19:01
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.

4 participants