<p>From a local user's point of view, the most important function of the full node is to tell them when funds are received and confirmed.  For instance, if the local user is a merchant, this is what they need to know in determining when to ship goods to customers.</p>

<p>So from this perspective, the most important thing for a full node to do if it finds an invalid transaction or block is to <strong>ignore it</strong>.  For an invalid transaction, it needs to <em>not</em> report the transaction to the user as received funds.  For an invalid block, it needs to <em>not</em> report this as confirmation for the transactions in the block, nor as an additional confirmation for transactions confirmed in previous blocks.  </p>

<p>A merchant considers an invalid transaction to be the same as no transaction at all.  A user who paid with an invalid transaction effectively just hasn't paid, and will be ignored until they come up with real funds.  An invalid block simply isn't a confirmation, and if we are waiting for some number of confirmations before shipping goods, then we just have to keep waiting.</p>

<p>Sure, the node can ban the other node that sent the offending data, or log an error, or whatever.  This is a good idea as far as saving bandwidth for valid data, or giving the user some general info about the state of network, or aiding in debugging.  But all this is secondary.</p>

CC BY-SA 3.0
2017-11-12T22:39:05.230Z
2017-11-12T22:39:05.230Z
Nate Eldredge
<p>When a node receives an invalid transaction, it will not include it in the mempool, and ban the peer that sent it the invalid transaction. I'm pretty sure it'll put something in the log about having received an invalid transaction.</p>

<p>When a node receives a block with an invalid transaction, it will notice this during the full validation of the block it performs. It will then reject the block, not add it to its blockchain and ban the node that relayed it.</p>

<p>Nodes will never relay information that they consider invalid. Nodes do not crash when they receive invalid blockchain data, that would be a huge vulnerability. I don't think it shows an error message, the node merely notes the event in the log. </p>

<p>The node will not distribute a warning. If it did, and other nodes were to trust such a warning, such a mechanism would be easy to exploit with a fake warning to induce DOS. Instead, every node that gets notice of the invalid block will simply arrive at the same conclusion and ban the malicious peer. If we manage to get fraudproofs, we could prove that a block was invalid and help lightweight clients defend themselves against it.</p>

CC BY-SA 3.0
2017-11-12T18:11:19.703Z
2017-11-12T18:11:19.703Z
Murch
<p>Full Nodes are supposed to validate every transaction and block in the blockchain, and provide valuable links for distributing blocks.  And because the consensus algorithm is extremely good, there are no invalid transactions in the block chain.</p>

<p>But if an invalid transaction was somehow created on a mined block, and identified by a full node, how would the node respond?  Would it show an error to the local user?  Distribute some sort of warning or notice on the network?  Simply crash?</p>

<full-node><validation>
What would a full node do if it finds an error?
abelenky
# What would a full node do if it finds an error?

(Asked by: username_0 on 2017-11-12)

Full Nodes are supposed to validate every transaction and block in the blockchain, and provide valuable links for distributing blocks. And because the consensus algorithm is extremely good, there are no invalid transactions in the block chain.

But if an invalid transaction was somehow created on a mined block, and identified by a full node, how would the node respond? Would it show an error to the local user? Distribute some sort of warning or notice on the network? Simply crash?

**Tags:** full-node, validation


---

## 2 answers

### Answer by username_1 on 2017-11-12. Score: 2

From a local user's point of view, the most important function of the full node is to tell them when funds are received and confirmed. For instance, if the local user is a merchant, this is what they need to know in determining when to ship goods to customers.

So from this perspective, the most important thing for a full node to do if it finds an invalid transaction or block is to **ignore it**. For an invalid transaction, it needs to *not* report the transaction to the user as received funds. For an invalid block, it needs to *not* report this as confirmation for the transactions in the block, nor as an additional confirmation for transactions confirmed in previous blocks.

A merchant considers an invalid transaction to be the same as no transaction at all. A user who paid with an invalid transaction effectively just hasn't paid, and will be ignored until they come up with real funds. An invalid block simply isn't a confirmation, and if we are waiting for some number of confirmations before shipping goods, then we just have to keep waiting.

Sure, the node can ban the other node that sent the offending data, or log an error, or whatever. This is a good idea as far as saving bandwidth for valid data, or giving the user some general info about the state of network, or aiding in debugging. But all this is secondary.


---

### Answer by username_2 on 2017-11-12. Score: 1

When a node receives an invalid transaction, it will not include it in the mempool, and ban the peer that sent it the invalid transaction. I'm pretty sure it'll put something in the log about having received an invalid transaction.

When a node receives a block with an invalid transaction, it will notice this during the full validation of the block it performs. It will then reject the block, not add it to its blockchain and ban the node that relayed it.

Nodes will never relay information that they consider invalid. Nodes do not crash when they receive invalid blockchain data, that would be a huge vulnerability. I don't think it shows an error message, the node merely notes the event in the log.

The node will not distribute a warning. If it did, and other nodes were to trust such a warning, such a mechanism would be easy to exploit with a fake warning to induce DOS. Instead, every node that gets notice of the invalid block will simply arrive at the same conclusion and ban the malicious peer. If we manage to get fraudproofs, we could prove that a block was invalid and help lightweight clients defend themselves against it.


---

