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

web3.eth.getTransaction returns null for existing, older than a year transactions in mainnet #22661

Closed
mdeliadi opened this issue Apr 13, 2021 · 5 comments

Comments

@mdeliadi
Copy link

I'm running a geth node in mainnet, version Kepler Verge (v1.10.2). The sync mode is "fast".

When I try to execute web3.eth.getTransaction for some old transaction (e.g. 0x74e51fb791fe430856ca0d55fdfd63d8ba08463a725241a6bc9c031f6c221874) I get null. The same happens with web3.eth.getTransactionReceipt.

What's wrong here? Shouldn't a fast node be capable of handling at least getTransaction?

If I do the same test with a more recent transaction (e.g. 0x53ea196d87a8cdd05a02abd41d80a99b7f0e1814824819cb2fd8f4b05e3a44a7) I'm able to get everything right.

The node has been created and synced less than a week ago. What's going on here?

@mdeliadi
Copy link
Author

@lukerQuant is this the same issue you reported yesterday here #22644 (comment) ?

@holiman
Copy link
Contributor

holiman commented Apr 13, 2021

https://github.com/ethereum/go-ethereum/releases/tag/v1.10.0

Geth 1.10.0 contains some changes which remove unnecessary data in the blockchain database. In particular, Geth no longer keeps transaction inclusion info for all transactions, and instead limits the storage of inclusion records to one year. For application developers, this change means that very old transactions can no longer be accessed by hash. Note: if you would like to
disable this behavior and keep inclusion information for all historical transactions, you can re-enable indexing using the --txlookuplimit=0 command-line flag. (#22293, #22419)

@holiman holiman closed this as completed Apr 13, 2021
@lukerQuant
Copy link

@lukerQuant is this the same issue you reported yesterday here #22644 (comment) ?

Yes it was. For me it was difficult to find this information but hopefully from now on developers will have the notes placed here to point them in the correct direction 👍

@mdeliadi
Copy link
Author

mdeliadi commented Apr 13, 2021

@holiman Thank You!!! But I don't understand how this is supposed to work. My node is in sync, I put the --txlookuplimit=0 and that's it? Did I just need to wait for the recovering of old txs? Is there a way to check this is actually happening?

@lukerQuant unfortunately the same happened to me!

@holiman
Copy link
Contributor

holiman commented Apr 13, 2021

Did I just need to wait for the recovering of old txs? Is there a way to check this is actually happening?

Yes, you should see something along the lines of Indexed transactions blocks=...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants