You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(authority): support failing validation effects commit post-consensus (#8927)
# Description of change
This makes so that a move authentication passing pre-consensus
(validators sign the TX) and failing post-consensus produces some
effects (gas charging).
I think starting from `test_abstract_account_post_consensus_failure()`
is a good way to understand the logic behind the change.
Basically, what is needed, is to make it so that this can happen:
1) Create an AA TX and make the majority of validators to sign it; this
means that the Move authentication based on the AA shared object state
is CURRENTLY successful.
2) Then, tamper with the AA shared object state by altering the state of
the AA shared object (e.g., create and send for execution a second TX
that changes a field of the AA shared object).
3) Finally, submit for execution the original certificate, i.e., the one
obtained from the signature of the majority of validators. This PR
changes the behavior at this step:
- before this PR, the TX execution simply didn't go through but just
raised a Move authentication error within the iota-core;
- whilst, after this PR, the Move authentication error is treated as
execution error and thus producing effects; the result is that all input
objects are considered when creating the transaction effects and the gas
coin is reduced with the authentication computation gas cost execution.
This PR also merges input objects in the case of a successful execution.
In order to produce effects, the method
`authenticate_then_execute_transaction_to_effects()` was added to the
execution engine. This new method executes all the steps necessary to
create the TransactionEffects after the authentication execution. This
means that, after running `authenticate_transaction_inner()` and failing
(as well as succeeding), the execution continues with
`execute_transaction_to_effects_inner()` in order to finish the job,
i.e., creating effects for a failing (or successful) transaction.
## Links to any relevant issues
Fixes#8908
## How the change has been tested
- [x] Basic tests (linting, compilation, formatting, unit/integration
tests)
- [x] Patch-specific tests (correctness, functionality coverage)
- [x] I have added tests that prove my fix is effective or that my
feature works
- [x] I have checked that new and existing unit tests pass locally with
my changes
0 commit comments