fix(eth): return null for replaced transaction lookups - #13664
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adjusts Lotus’ Ethereum-compatible transaction lookup semantics so that eth_getTransactionByHash and eth_getTransactionReceipt return null for transactions that were replaced (RBF) before execution, instead of silently returning data for the replacement transaction. This aligns Ethereum API behavior with expected replacement semantics while still supporting Filecoin’s “replacement-aware” behavior via the allowReplaced flag.
Changes:
- Add a sentinel error (
stmgr.ErrMessageReplaced) to classify “message was replaced” outcomes from message searches. - Update
StateSearchMsg(..., allowReplaced=false)to treat “replaced” as “not found” (returnnil, nil) and update ETH transaction/receipt lookups to useallowReplaced=false. - Add an integration test covering replacement lookups and update the changelog.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| node/impl/full/state.go | Converts ErrMessageReplaced into a nil result when allowReplaced=false for StateSearchMsg. |
| node/impl/eth/transaction.go | Makes ETH hash/receipt lookups return null for replaced tx hashes by disabling replacement-following. |
| chain/stmgr/searchwait.go | Introduces ErrMessageReplaced and wraps relevant replacement-detection errors with it. |
| chain/stmgr/searchwait_test.go | Asserts replacement failures are classified via errors.Is(..., ErrMessageReplaced). |
| itests/eth_hash_lookup_test.go | Adds an end-to-end test ensuring replaced tx hash lookups return null. |
| CHANGELOG.md | Documents the ETH API behavior change. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
rvagg
force-pushed
the
rvagg/replacement-msgs-eth
branch
from
June 11, 2026 19:01
f46e8dc to
d20771f
Compare
LexLuthr
approved these changes
Jun 30, 2026
rvagg
enabled auto-merge (squash)
July 6, 2026 03:48
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.
Replaces #13661
When you ask for a specific transaction hash, we only return the data for that specific transaction hash, not a replacement transaction that will have a different hash but has replaced it in practice. Standard Filecoin APIs encourage viewing replaced messages and what they are replacing as roughly the same. This PR takes the opinion that Ethereum APIs shouldn't silently convert for you if the replacement got through and you're asking for the original.
DIscussion in slack; there's one concern that this makes it more difficult for Curio to find replacement msgs but I'm not sure if that's structural or can be easily solved by just querying by the replacement hash.