fix: add retry to fastrpc db check before ignoring txn#919
Open
fix: add retry to fastrpc db check before ignoring txn#919
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Describe your changes
Issue:
When a row had no bid cost indexed AND wasn't found in fastrpc's mctransactions_sr, the processor marked it processed=1, miles=0 immediately and never called submitToFuel. This was to not award miles to users unless they used fastrpc. Two legitimate-user categories were silently dropped:
Permit-path rows hit by fastrpc indexer lag. Permit swaps are always executor-submitted via fastrpc by construction, so a missing fastrpc row can only mean the indexer is behind — never a real bypass. 20 rows since 2026-03-01 fell into this bucket (all now visible in fastrpc).
ETH-path rows with short-lived indexer lag. A single missing-from-fastrpc result was treated as final, with no retry. ~42 rows got denied miles before the indexer caught up.
~259 ETH-path rows genuinely bypassed fastrpc and correctly receive 0 miles — unchanged.
Changes:
Extract bid-check branch into decideBidCheckOutcome() returning Proceed / Retry / Orphan.
Permit path: treated as in-fastrpc unconditionally → runs through existing 15-min bid-grace, never orphans.
ETH path not in fastrpc: retries every cycle for up to 24h (orphanRetryWindow) before orphaning.
Both processMiles and processERC20Miles use the shared helper.
TestDecideBidCheckOutcome: 14 table-driven cases covering every branch.
Backfill
After changes are live I will run an SQL reset to flip the affected historical orphans back to processed=false so the updated processor retries them:
All 20 permit-path orphans (recoverable via the permit short-circuit).
The ~42 ETH-path orphans currently visible in fastrpc (new code will find them and process normally).
ETH-path rows still missing from fastrpc are left alone.
Issue ticket number and link
Fixes # (issue)
Checklist before requesting a review