aztec-packages
aztec-packages copied to clipboard
fix: making sent tx's fail at validation, rather than waiting for the non inclusion of the tx at a block
Right now when we send a TX to the node, it gets "fake" validated; because if invalid, a no-op occurs, it doesn't give users feedback directly in any way. The transaction is not forwarded to the p2p client, and nothing is returned to the user.
This change makes a sent transaction fail early if the transaction is invalid (that is, unable to be included in any block to advance state).
The mechanism by which this occurs is similar to what is implemented for a simulation, that is we use the previously introduced endpoint on the node to validate if the transaction is not invalid according to our above definition, and if it is invalid, we throw an error on the spot.