pdp: re-fetch receipt when piece add extraction finds no logs - #1474
Open
TippyFlitsUK wants to merge 1 commit into
Open
pdp: re-fetch receipt when piece add extraction finds no logs#1474TippyFlitsUK wants to merge 1 commit into
TippyFlitsUK wants to merge 1 commit into
Conversation
eth_getTransactionReceipt can return a successful receipt carrying no logs for a transaction that did emit events. Curio stores whatever it gets and nothing re-checks, so PiecesFromReceipt fails on every watcher pass, pieces_added stays false, and the same transactions are retried indefinitely while their pieces stay absent from local state. Two shapes were observed on a mainnet node, both confirmed against chain state via EventsRoot and ChainGetEvents. In the first the receipt comes back under the queried hash with logs missing and the same query returns them shortly after. In the second the receipt comes back keyed to a different hash for the same message, same nonce and same block, and the logs are never populated under the hash that was queried. On extraction failure, re-fetch the receipt and follow the returned hash when it differs, then retry. The corrected receipt is written back so the fetch is not repeated on later passes. If the re-fetch fails the original error is returned and behaviour is unchanged. processDataSetPieceAdd already received an ethClient it did not use.
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.
Priority
Not urgent. This is not a v1.28.5 regression, it has no observed proving impact, and it is unrelated to the instability behind the current release. It predates that work and can wait behind it. Raising it now only because the diagnosis is complete while it is fresh.
What happens
eth_getTransactionReceiptsometimes returns a successful receipt carrying no logs for a transaction that did emit events.watch_eth.gomarshals whatever it gets and stores it, and nothing re-checks.PiecesFromReceiptthen fails on every watcher pass, the row keepspieces_added = FALSE, and the same transactions are retried indefinitely while their pieces stay absent from local state.Two shapes, both confirmed against chain state via
EventsRootandChainGetEvents:Numbers
On my mainnet node this stranded 10 transactions and 220 rows across two data sets, and the count grew through the day. Every one of them had its 27 events present on chain.
Two SPs shipping logs show the symptom in an eight day window: mine at 244,276 warnings and Mongo2Stor Mainnet at 24,253,337. Those are retry-loop warnings rather than distinct affected transactions, so they indicate how long rows sit rather than how many there are. I cannot see the stranded count on the other node.
The change
On extraction failure, re-fetch the receipt via the eth client and follow the returned
TxHashwhen it differs from the one queried, then retry extraction. The corrected receipt is written back tomessage_waits_ethso the fetch is not repeated on later passes. If the re-fetch itself fails, the original error is returned and behaviour is unchanged.processDataSetPieceAddalready received anethClientit did not use, so no new plumbing was needed.One or two RPC calls per stuck transaction, and no contract calls.
Verification
Running on a mainnet node since 15:01 UTC on 28 August. All 220 stranded rows materialised, including the three that required following the returned hash. Zero duplicate or overlapping
piece_idvalues afterwards, and theFailed to process piece addloop stopped.