You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a nodejs script which gets the latest block synced and iterate over all the transactions in it and then get the receipt for each transaction. Randomly I get null value instead of the receipt object. I am using web3 package from npm to do all this work. I even added a delay of 60 seconds from the block timestamp and then try to read the transaction receipt, but I still get null values. It is all random and has no fixed pattern. In some cases, receipt for all transactions in a block return null while in other cases only a few return null. Any idea why could this be happening?
The text was updated successfully, but these errors were encountered:
I have an update for my issue. I realised I get null receipts because I was reading the blocks immediately once its synced and I was not waiting for a minimum block confirmation (say wait for 3 or 5 blocks), and due to that there is a very high chance of blocks or transactions inside a block getting dropped and replaced. I have changed my code to wait for 5 block confirmations for now and I no longer get null receipts.
System information
Geth version:
1.10.2-stable
OS & Version: linux (centos)
Commit hash :
97d11b0187b4695ccf44e3b71b54155fe405a36f
Expected behaviour
Transaction receipt should not be null for synced block
Actual behaviour
Transaction receipt is null
Steps to reproduce the behaviour
Start blockchain sync using geth in light mode
I installed geth (v1.10.2-stable) on my server and started the sync in light mode, the exact command is below:
geth --http --http.api personal,eth,net,web3 --http.addr=0.0.0.0 --http.port 8545 --gcmode full --syncmode light --cache 1024
I have a nodejs script which gets the latest block synced and iterate over all the transactions in it and then get the receipt for each transaction. Randomly I get null value instead of the receipt object. I am using web3 package from npm to do all this work. I even added a delay of 60 seconds from the block timestamp and then try to read the transaction receipt, but I still get null values. It is all random and has no fixed pattern. In some cases, receipt for all transactions in a block return null while in other cases only a few return null. Any idea why could this be happening?
The text was updated successfully, but these errors were encountered: