8

I'm trying to figure out how an invalid block would come into existence and what happens (technically) to valid transactions in the invalid block.

From what I understand, invalid transactions (like spending more ETH than the account balance) won't even make it into the block. So is it always fraud or chance (when 2 miners solve the puzzle at the same time for instance)?

Also, when a block does turn out to be invalid, are the valid transactions that were included returned to the transaction pool? Can someone explain to me how this works? Also in the case of two miners publishing a block at the same time...are both including the same transactions, are they still in the pool until ..x.. confirmations have occured?

A lot of questions, I'm just a bit unclear on actual 'invalid block' reasons and how the system makes sure all valid transactions will still be included in another block

thanks!

1 Answer 1

4

I'm trying to figure out how an invalid block would come into existence

A miner can create an invalid block in many ways (such as putting an invalid timestamp on it), including having invalid transaction in the block.

But the invalid block basically does not exist because all other miners and nodes will just ignore the block.

From what I understand, invalid transactions (like spending more ETH than the account balance) won't even make it into the block. So is it always fraud or chance

Correct, miners will not include invalid transactions in a block: they would not get any rewards from it. An invalid transaction is generally fraud or could be created by using buggy software. Generally, a valid transaction (that's not in a block yet) will always remain valid: if Alice writes a check to pay Bob, the check will always be valid: only Alice could try to invalidate the check by say sending all her money to Charlie using the same check number.

when a block does turn out to be invalid, are the valid transactions that were included returned to the transaction pool?

Each miner has their own transaction pool, and they each can decide which transactions to include a block. Since an invalid block is just ignored, miners and nodes will keep all transactions in the invalid block in their transaction pool (they don't even know that there were transactions in the invalid block, to remove them from the pool in the first place).

in the case of two miners publishing a block at the same time...are both including the same transactions, are they still in the pool until ..x.. confirmations have occured?

Generally, no, both miners are not including the same transactions. By chance, both may have included the same transactions, but each miner can decide what to include, and the order of the transactions. Each miner and node can have their own rule about when transactions will be removed from the pool, as this isn't part of the protocol.

I'm just a bit unclear on actual 'invalid block' reasons and how the system makes sure all valid transactions will still be included in another block

An invalid block is ignored, so any transactions in it do not affect the transaction pool. The transactions will remain in the pool and since miners would like to collect the gas/transaction fees, they are likely to include them in another block.

3
  • Just to be certain.. when you say "each miner has their own transaction pool", all transactions are propagated to each of these pools right? I mean the set of transactions is the same, it's just up to the miner which ones, if any, it will include in the block?
    – Syg
    Oct 10, 2016 at 18:02
  • Yes, generally every node will propagate its valid transactions to its peers, so over time a transaction should be in the pool of every single miner.
    – eth
    Oct 11, 2016 at 16:33
  • Glad it helped!
    – eth
    Oct 11, 2016 at 22:42

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.