-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Description
Currently, we will commit blocks that may have invalid txs in them. This is done on purpose, to avoid requiring the block to be executed before consensus can go to work. This is a performance optimization, but comes at some UX cost, and led at least one user to raise an issue (#2162).
Txs return results that include a status code, which can be non-zero indicating an invalid tx. We don't currently store this information anywhere in the blockchain itself (just indexed on disk). So long as we allow this, we should probably include a bit-array of valid/invalid txs in the header.
Another alternative is to just run CheckTx on all txs when we validate the block before prevoting. This would eliminate invalid txs (assuming CheckTx is implemented correctly), but would add some performance overhead.
Finally, we might want to consider a mechanism for detecting bad proposals and punishing for them, though this is a harder and less-immediate problem.