stress,client: nonce chaos and failed execution options #604
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This updates the stress tool with:
-nc
) option to apply a random jitter to the correct nonce at a rate of 1/nc times.create_post
action, create action call transactions that intentionally fail execution with incorrect argument count or types. This ensures nonce and balance updates happen regardless of the execution outcome (tx code), and that the node is resilient to failures in user SQL queries as well as the engine's handling of procedure call errors.This also fixes a bug in
core/client.Client
where theWithFee
option was ignored. This is not critical since kwil-cli does not use it like it does theWithNonce
option from--nonce
, but I did want to have the stress tool do unexpected things with thetx.Body.Fee
field and I realized this was impossible.Putting this PR up now despite more related work being in progress because I am now diagnosing the cause of a consensus failure and persistent app hash mismatch after restart. I will investigate and find the root cause and fix, but in short, on validator node A
FinalizeBlock
returned an error because postgres/connection was down (I had closed my laptop lid), but on sentry node B it had gotten throughFinalizeBlock
without error for that same block before the pg connection died. Node B finalize had gotten apphash X. After restarting node A, it tried finalizing that block again and got apphash Y. I'm not sure why since the transaction for that block was not committed (and not prepared either according to "0 orphaned" prepared transactions reported on restart. Investigating...