Skip to content

Conversation

@miker83z
Copy link
Contributor

@miker83z miker83z commented Oct 16, 2025

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

  • Basic tests (linting, compilation, formatting, unit/integration tests)
  • Patch-specific tests (correctness, functionality coverage)
  • I have added tests that prove my fix is effective or that my feature works
  • I have checked that new and existing unit tests pass locally with my changes

@miker83z miker83z requested a review from valeriyr October 16, 2025 15:25
@vercel
Copy link

vercel bot commented Oct 16, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

6 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
apps-backend Ignored Ignored Preview Oct 27, 2025 1:53pm
apps-ui-kit Ignored Ignored Preview Oct 27, 2025 1:53pm
iota-evm-bridge Ignored Ignored Preview Oct 27, 2025 1:53pm
iota-multisig-toolkit Ignored Ignored Preview Oct 27, 2025 1:53pm
rebased-explorer Ignored Ignored Preview Oct 27, 2025 1:53pm
wallet-dashboard Ignored Ignored Preview Oct 27, 2025 1:53pm

@iota-ci iota-ci added sc-platform Issues related to the Smart Contract Platform group. vm-language Issues related to the VM & Language Team labels Oct 16, 2025
@miker83z miker83z requested review from Dkwcs and TheMrAI October 17, 2025 11:33
@miker83z miker83z marked this pull request as ready for review October 17, 2025 11:33
@miker83z miker83z requested review from a team as code owners October 17, 2025 11:33
Copy link
Contributor

@valeriyr valeriyr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this PR, we change the conception of how a transaction with a move authenticator is executed. Since an authenticator can produce the result, I think we need to refactor the way it is called. We need a stronger connection between an authenticator and the transaction, and don't consider the authenticator call as something independent.

Copy link
Contributor

@TheMrAI TheMrAI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked the code mostly from technical perspective. Can't really comment on the design choices, will trust @valery to handle that.

Only thing concerning was the O(n^2) object merger, but lack the deep knowledge on the domain to suggest something better.
With the above disclaimers I approve.

Copy link
Contributor

@piotrm50 piotrm50 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving files owned by consensus - iota-core, iota-transaction-checks and iota-types

@miker83z miker83z marked this pull request as draft October 23, 2025 11:02
Comment on lines 837 to 847
// if additional_mutable is true and
// input_mutable is false, then swap
if additional_mutable && !input_mutable {
existing_object.input_object_kind =
InputObjectKind::SharedMoveObject {
id: input_id,
initial_shared_version:
input_initial_shared_version,
mutable: true,
};
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is a use case for this?
Authenticator inputs are always immutable, so it might make sense to create a more specific function to extend transaction inputs with authenticator ones?
Can we consider this function(check_and_extend_input_objects) as a method of the InputObjects struct? It looks generic enough to be added as extend_no_duplicates, like it was done before.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this PR, we will need to push the account object into the list as well: #8986

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

About the if additional_mutable && !input_mutable check:

  • this extensions mutates the left side (input) and reads from the right side (additional);
  • where we now call it, we now that the left side is tx_inputs and right side is auth_inputs;
  • however, in a more general case, if we call check_and_extend_input_objects we assume the left and right have been checked already to be good for their cases (now that I am thinking about it, the function signature should be (input_objects: &mut CheckedInputObjects,additional_objects: &CheckedInputObjects), changed in a5589fc);
  • this means that the right side, might have a shared object which is mutable (maybe in the authenticatorV2?) and we are good with it;
  • then, from the point of view of the check_and_extend_input_objects function, if one of the sides has mutable:true, then in the final result the mutable must be true; this because keeping mutable:false in the final result when one of the two sides had mutable:true will break the check that happened before calling check_and_extend_input_objects.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

About the rest of the comments: yes, we need to push the account object as well and potentially also the sponsor authenticator input objects; this I think it could be better handled in a dedicated issue.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

idk, for me this logic is misleading, because in our case, if the right side(auth inputs) contains mutable shared objects, it is an error which shouldn't happen. We should have at least a debug assert here, since we don't really expect such inputs here. We can remove this assert when it is needed.

@miker83z miker83z marked this pull request as ready for review October 24, 2025 15:40
@miker83z miker83z self-assigned this Oct 24, 2025
@miker83z miker83z linked an issue Oct 24, 2025 that may be closed by this pull request
@miker83z miker83z removed the request for review from a team October 24, 2025 15:45
@miker83z miker83z mentioned this pull request Oct 27, 2025
2 tasks
…nch' into vm-lang/aa-auth/8908-move-auth-inputs
@miker83z miker83z merged commit 821de7b into vm-lang/aa-auth/8116-feature-branch Oct 27, 2025
36 of 40 checks passed
@miker83z miker83z deleted the vm-lang/aa-auth/8908-move-auth-inputs branch October 27, 2025 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

sc-platform Issues related to the Smart Contract Platform group. vm-language Issues related to the VM & Language Team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[AA] Handle MoveAuthenticator inputs the same as a the TX inputs

5 participants