openethereum / parity-ethereum

The fast, light, and robust client for Ethereum-like networks.
Other
6.81k stars 1.68k forks source link

getPastLogs cannot retrieve the entire history in a fast prunning node #11808

Closed hellwolf closed 3 years ago

hellwolf commented 4 years ago

Synced kovan node with the following options:

    --chain kovan \
    --pruning fast \

I am aware of that by not using archive pruning, it is not possible to query past state beyond certain "buffer blocks", and from various internet search, I have been expecting web3.getPastLogs would still be able to query the pastLogs from even the blocknumber 0.

Do I have the wrong assumption, if so, how to achieve that without going to full archive node?

rakita commented 4 years ago

I think you have a good assumption, the node cant return past block cause it does not have them.

hellwolf commented 4 years ago

I think you have a good assumption, the node cant return past block cause it does not have them.

Hi, but my assumption was that "web3.getPastLogs would still be able to query the pastLogs from the blocknumber 0". It seems openethereum doesn't do that, while geth could do that.

rakita commented 4 years ago

Sorry, I didn't say it clearly. The assumption on "buffer blocks" is correct and we cant return pastLogs from blocknumber 0 because we don't have those blocks on the client. Pruning fast option is exactly that.