I was looking into an issue with RPC calls with eth_getTransactionByHash and recognized for older transactions it returns null for geth full nodes:

Tx 511 days ago: 0x9f15fa4b2fe31afa2953331dfb58662422c6eb6b4fb3a739ae6f40c469979695.

Requesting own local full node:

kuzdogan@kuzdogan-UX331UN:~$ curl --data '{"method":"eth_getTransactionByHash","params":["0x9f15fa4b2fe31afa2953331dfb58662422c6eb6b4fb3a739ae6f40c469979695"],"id":1,"jsonrpc":"2.0"}' -H "Content-Type: application/json" -X POST http://localhost:8545

Requesting an Infura node:

curl --data '{"method":"eth_getTransactionByHash","params":["0x9f15fa4b2fe31afa2953331dfb58662422c6eb6b4fb3a739ae6f40c469979695"],"id":1,"jsonrpc":"2.0"}' -H "Content-Type: application/json" -X POST https://mainnet.infura.io/v3/XXXXXXX

Noting it is possible to retrieve the same tx via eth_getTransactionByBlockNumberAndIndex. And for recent transactions, eth_getTransactionByHash works.

I guess the full nodes stop indexing transactions when they are old. (Moved to "ancient"? Pruned?).

So my questions are:

  • Is it because the transactions are removed from "index" in a geth full node?
  • If so, when is this done? 1 year? 6 months? N blocks?
  • How could a transaction be retrieved in this case by only knowing the transaction hash?

1 Answer 1


I learned this is due to the following option in geth:

--txlookuplimit value               Number of recent blocks to maintain transactions index for (default = about one year, 0 = entire chain) (default: 2350000)

So yeah it is by default set to ~1year and my local node should have this value where Infura nodes probably have the entire chain set.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.