2

Let's say Alice wants to send a transaction tx to the blockchain and the transaction is added to a block that belongs in a fork. Then after k blocks when the network reaches consensus this tx does not belong in the blockchain.

How do miners know that this tx is still pending?

Does Alice get a failed tx message?

1

When the reorg of the blockchain happens, nodes will know which blocks do not belong to the longest chain and they'll return the corresponding transactions to the transaction pool if they're not already part of the longest chain.

Alice will not get transaction failed message. Rather she will have to check herself if the transaction is still included in the longest chain by trying to obtain a valid transaction receipt. That's also the reason why it is recommended to wait in Ethereum for 12 confirmations before assuming that the transaction has been processed. See "What number of confirmations is considered secure in Ethereum?"

One more thing to know is that, there is no 100% certainty that a transaction has been finally processed, since Bitcoin and Ethereum are implementing a probabilistic solution to the BFT problem. I.e., the confidence grows with more confirmations, but it never reaches 100%. See "How is the Two Generals Problem solved with proof of work?"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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