Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Eth JSON-RPC API: eth_getTransactionByHash should return nil when not found #9932

Merged
merged 1 commit into from
Dec 22, 2022

Conversation

raulk
Copy link
Member

@raulk raulk commented Dec 22, 2022

Related Issues

Hardhat users are having troubles deploying contracts to Wallaby via Hardhat.

The problem was introduced in 20f27af. That commit introduced the ability to resolve transactions pending in the mpool, but incorrectly returned an error when the transaction was not found. Eth clients expect a nil here, and Hardhat will send a tx and then poll the endpoint. But it will fail if an error is returned.

And one would think: if Wallaby users are deploying via Glif endpoints, then surely the Glif endpoint should be able to find the transaction within its mpool, right? Where this likely goes sideways is with load balancing.

  1. The contract is deployed through origin node A (eth_sendRawTransaction).
  2. The call to fetch the tx is routed to node B (eth_getTransactionByHash), which hasn't had the tx replicated to its mpool yet. If this request had gone to A, I posit we wouldn't be seeing this issue now.

Proposed Changes

Return nil from eth_getTransactionByHash when not found.

Additional Info

Checklist

Before you mark the PR ready for review, please make sure that:

  • Commits have a clear commit message.
  • PR title is in the form of of <PR type>: <area>: <change being made>
    • example: fix: mempool: Introduce a cache for valid signatures
    • PR type: fix, feat, build, chore, ci, docs, perf, refactor, revert, style, test
    • area, e.g. api, chain, state, market, mempool, multisig, networking, paych, proving, sealing, wallet, deps
  • New features have usage guidelines and / or documentation updates in
  • Tests exist for new functionality or change in behavior
  • CI is green

@raulk raulk requested a review from a team as a code owner December 22, 2022 11:54
@arajasek arajasek merged commit 6faa901 into feat/nv18-fevm Dec 22, 2022
@arajasek arajasek deleted the raulk/eth-jsonrpc-api-fixes-1 branch December 22, 2022 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants