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 PR introduces a way to override the transaction error handler and provide a custom implementation.
Context:
The fuzzer generates a sequence of one or more instructions that are processed/executed sequentially.
Originally, in case of failed transaction (instruction), the fuzzer skipped the remaining instructions in the sequence and continued with a new fuzzer iteration. This has been modified unintentionally during refactoring in a way, that a failed transaction did not skip the subsequent instructions. Therefore also sequences with instructions that all fail are completely executed.
With this PR, the default behavior was reverted so that the remaining instructions are skipped in case of transaction failure.
The default behavior can be overridden by providing a custom implementation of the
tx_error_handler
method of theIxOps
trait. To continue to process remaining instructions in a sequence after a given instruction execution failed, it is possible to simply return anOk(())
result such as:In order to ignore the transaction errors and continue with the ix sequence execution, it is necessary to provide this implementation of
tx_error_handler
method for each instruction. One global setting might be implemented in the future if it will be necessary/useful.Besides that, this method can be used to inspect the kinds of transaction errors. As described in the trait's docs:
If this PR will be merged, it would make sense to also extend the web docs.