fix(eth): return nil for eth transactions not found#12999
Merged
Conversation
561cc23 to
3396934
Compare
3396934 to
2550f4a
Compare
rvagg
commented
Mar 31, 2025
Member
|
@masih : can you please take a look at this so we can get it merged and as a slight way to learn more about the ETH APIs? |
masih
approved these changes
Apr 8, 2025
This was referenced Apr 12, 2025
8 tasks
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.
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_getTransactionReceiptwe're doing aStateSearchMsgon the CID we get from atxHash.ToCid()and that will return anipld: count not findwhen it gets down in toGetCMessagemessage 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 returnnilwhich I believe is what Eth tooling dows.