fix(eth): return nil for eth transactions not found #12999
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.
Originally reported by @dumikau. I'm pretty sure the "not found" path for Eth calls should be to return nothing, but the usual path is: (1) search in ChainIndexer for the Eth hash and use that if it has it, then (2) to a naive conversion from the hash to a CID and use that (
txHash.ToCid()
). That second path is usually not what the user intends, and if we don't have it in the ChainIndexer then it's probably not landed on chain yet. But in the current case foreth_getTransactionReceipt
we're doing aStateSearchMsg
on the CID we get from atxHash.ToCid()
and that will return anipld: count not find
when it gets down in toGetCMessage
message trying to fetch it from the blockstore. Then we end up with this confusion message with a CID that bears no relationship to the hash the user asked for (from their perspective) and it's just confusing. I think the right thing to do is returnnil
which I believe is what Eth tooling dows.