3

At some point in time, my local Geth node reported this tx http://testnet.etherscan.io/tx/0xa5b96f92520f18113061a3d7982709e1656988a74ce76760792f90e7ec92fb18 with the call eth.getBlock(1256437) in the block 1256437.

The same tx with the same hash appeared also on the next block 1256438 with the call eth.getBlock(1256438) at a later point in time.

Now, eth.getBlock(1256437) reports empty transaction list.

How can this happen? What is the edge case I'm not catching? Can we assume that the transaction data (from, to, gas, value, data, etc.) apart from the block number remains same between the "block hop" or is it possible for them to change also?

AFAIK, pending transactions/blocks are not the reason because I'm always calling getBlock(N) with N <= eth.blockNumber to make sure we are dealing with mined blocks only. Please correct if my assumption is wrong and eth.blockNumber returns the pending block number too.

Also, this is a fully synced node this happened with.

1 Answer 1

3

You've encountered a chain reorganization. For ideas on how to handle, see How can a DApp detect a fork or chain reorganization using web3.js or additional libraries?

Can we assume that the transaction data (from, to, gas, value, data, etc.) apart from the block number remains same between the "block hop" or is it possible for them to change also?

Yes, the transaction is unchanged in this case. Any change to the transaction data would require it to be signed again: any data change without an updated signature would be immediately recognized by the network as an invalid transaction and will not be included in the blockchain.

Your Answer

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

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