Skip to content

fix(eth): return null for replaced transaction lookups - #13664

Merged
rvagg merged 3 commits into
masterfrom
rvagg/replacement-msgs-eth
Jul 6, 2026
Merged

fix(eth): return null for replaced transaction lookups#13664
rvagg merged 3 commits into
masterfrom
rvagg/replacement-msgs-eth

Conversation

@rvagg

@rvagg rvagg commented Jun 11, 2026

Copy link
Copy Markdown
Member

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.

Copilot AI review requested due to automatic review settings June 11, 2026 18:57
@github-project-automation github-project-automation Bot moved this to 📌 Triage in FilOz Jun 11, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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” (return nil, nil) and update ETH transaction/receipt lookups to use allowReplaced=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
rvagg force-pushed the rvagg/replacement-msgs-eth branch from f46e8dc to d20771f Compare June 11, 2026 19:01
@BigLep BigLep moved this from 📌 Triage to 🔎 Awaiting Review in FilOz Jun 15, 2026
@rvagg
rvagg requested a review from LexLuthr June 30, 2026 07:15
@github-project-automation github-project-automation Bot moved this from 🔎 Awaiting Review to ✔️ Approved by reviewer in FilOz Jun 30, 2026
@rvagg
rvagg enabled auto-merge (squash) July 6, 2026 03:48
@rvagg
rvagg merged commit bf21ebb into master Jul 6, 2026
98 checks passed
@rvagg
rvagg deleted the rvagg/replacement-msgs-eth branch July 6, 2026 03:53
@github-project-automation github-project-automation Bot moved this from ✔️ Approved by reviewer to 🎉 Done in FilOz Jul 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🎉 Done

Development

Successfully merging this pull request may close these issues.

4 participants