Submission rejected based on on-chain revert errors #1234
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Classify and mark payer reports as
SubmissionRejectedwhen on-chain submission fails with invalid sequence IDs inpkg/payerreport/workers/submitter.goThis 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 renamesErrInvalidSequenceIdstoErrInvalidSequenceIDsand maps protocol code0xa7ee0517to the new name. It addsSubmissionRejectedwith value3and updates the submitter to set this status on matching errors.blockchain.ProtocolErrorwithUnwrap()andIsErrInvalidSequenceIDs()and adjustBlockchainErrorchecks in errors.goSubmitPayerReportto returnblockchain.ProtocolErrorin interface.go and update the implementation in payer_report_manager.goSubmissionRejectedstatus and store transition API in report.go and store.go, and defineSetReportSubmissionRejectedin interface.go📍Where to Start
Start with the worker flow in
payerreport.workers.SubmitterWorker.SubmitReportsin submitter.go, then review the error type changes in errors.go and the interface return type update in interface.go.Changes since #1234 opened
payerreport.workers.SubmitterWorker.SubmitReportsmethod for submission rejections based on invalid sequence IDs [a486539]SetReportSubmissionRejectedmethod inpayerreportpackage 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
SubmitReportstreats any non-nilProtocolErrorfromsubmitReportas a failure unless it isIsErrInvalidSequenceIDs(). TheProtocolErrorinterface explicitly exposesIsNoChange(), which is commonly used to indicate an idempotent or already-applied condition that should not be considered an error. By not handlingIsNoChange()separately, the worker will log an error and propagatelatestErreven 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 returnProtocolErrorwith richer semantics without updating the consumer logic to preserve contract parity. The fix is to checksubmitErr.IsNoChange()and either skip error propagation (and optionally callSetReportSubmitted) or log at a lower level without treating it as a failure. [ Low confidence ]