Skip to content

Conversation

@miker83z
Copy link
Contributor

@miker83z miker83z commented Jan 20, 2026

Description of change

Based on this scenario -> #9371 Receiving objects could be used to make AA TX certificates invalid, even after these were signed by the majority of validators.

This PR makes so that any TX trying to receive an object owned by an AA account (i.e., an object having a AuthenticatorFunctionRef dynamic field) would abort execution (a validator could still sign the certificate, but the execution makes sure that the received objects will not be received and won't bump the sequence number).

This PR also fixes a small issue related to duplicate function names in a package.

Links to any relevant issues

Closes #9371
Fixes #9862

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 review from a team as code owners January 20, 2026 16:53
@vercel
Copy link

vercel bot commented Jan 20, 2026

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

6 Skipped Deployments
Project Deployment Review Updated (UTC)
apps-backend Ignored Ignored Preview Jan 26, 2026 9:05am
apps-ui-kit Ignored Ignored Preview Jan 26, 2026 9:05am
iota-evm-bridge Ignored Ignored Preview Jan 26, 2026 9:05am
iota-multisig-toolkit Ignored Ignored Preview Jan 26, 2026 9:05am
rebased-explorer Ignored Ignored Preview Jan 26, 2026 9:05am
wallet-dashboard Ignored Ignored Preview Jan 26, 2026 9:05am

Request Review

@miker83z miker83z requested review from Dkwcs and lzpap January 20, 2026 16:53
@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 Jan 20, 2026
@miker83z miker83z self-assigned this Jan 20, 2026
@miker83z miker83z added this to the v1.16.x milestone Jan 20, 2026
@miker83z miker83z linked an issue Jan 20, 2026 that may be closed by this pull request
3 tasks
@miker83z miker83z force-pushed the vm-lang/aa-auth/9862-remove-receive-aa-accounts branch from bf4bf69 to abad653 Compare January 20, 2026 16:54
@miker83z miker83z marked this pull request as draft January 21, 2026 13:41
@miker83z miker83z force-pushed the vm-lang/aa-auth/9862-remove-receive-aa-accounts branch from c891ab4 to 9277a76 Compare January 22, 2026 09:22
@miker83z miker83z marked this pull request as ready for review January 23, 2026 15:37
@miker83z miker83z changed the title fix(core): tx input loader rejects receiving objects owned by AA accounts fix(core): reject receiving objects owned by AA accounts Jan 23, 2026
Copy link
Member

@lzpap lzpap left a comment

Choose a reason for hiding this comment

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

@miker83z please modify crates/iota-adapter-transactional-tests/tests/abstract_account/account/receive_object.move as the tests are failing due to that test case expecting a receive to go through on an account object

@miker83z miker83z changed the base branch from vm-lang/aa-auth/9371-Test-the-receiving-gas-coin-in-two-separate-TXs to vm-lang/aa-auth/8805-beta-feature-branch January 24, 2026 10:34
@miker83z miker83z linked an issue Jan 24, 2026 that may be closed by this pull request
@miker83z miker83z requested a review from a team as a code owner January 26, 2026 09:04
Copy link
Member

@lzpap lzpap left a comment

Choose a reason for hiding this comment

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

lgtm!

mutated: object(2,0), object(2,2), object(5,0)
gas summary: computation_cost: 1000000, computation_cost_burned: 1000000, storage_cost: 3351600, storage_rebate: 3351600, non_refundable_storage_fee: 0
Error: Transaction Effects Status: Move Runtime Abort. Location: iota::transfer::receive_impl (function index 12) at offset 0, Abort Code: 5
Debug of error: MoveAbort(MoveLocation { module: ModuleId { address: iota, name: Identifier("transfer") }, function: 12, instruction: 0, function_name: Some("receive_impl") }, 5) at command Some(0)
Copy link
Contributor

@Dkwcs Dkwcs Jan 26, 2026

Choose a reason for hiding this comment

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

Does this error explain the receiving case enough?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, but that's the only one we could obtain through a native function I guess.

cfg.max_auth_gas = Some(250_000_000);
// Increase the base cost for transfer receive object in devnet, since the
// implementation now does check if parent is not an account.
cfg.transfer_receive_object_cost_base = Some(100);
Copy link
Contributor

Choose a reason for hiding this comment

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

Just to clarify, how was the new value calculated?
The current cost is 52, dynamic_field_has_child_object_cost_base equals 100.
Should the new value be 52 + 100 = 152?

Copy link
Member

Choose a reason for hiding this comment

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

the current value of 52 covers the cost of:

  1. querying the database against an objects id, loading up the child,
  2. comparing the type of the loaded object to the one expected.

With the receive parent check, we only do essentially 1, as we know that under that key there can only be stored a dynamic field with a certain type, so no need to check. Therefore, the new check only adds an additional database query which makes us think that roughly double the cost is appropriate, hence 100

Copy link
Member

Choose a reason for hiding this comment

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

@valeriyr we could also do 104 if you deem the heavy lifting is the db query.

Copy link
Contributor

@valeriyr valeriyr Jan 26, 2026

Choose a reason for hiding this comment

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

I am asking because, as far as I see, we added the same check as can be found here(child_object_exists is the only function that is called here):


It costs 100.

transfer_freeze_object_cost_base: 52
transfer_share_object_cost_base: 52
transfer_receive_object_cost_base: 52
transfer_receive_object_cost_base: 100
Copy link
Contributor

@Dkwcs Dkwcs Jan 26, 2026

Choose a reason for hiding this comment

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

Just would like to know - what is the mechanism for changing those values? (Why 100 not other value, like 152? )

const E_UNABLE_TO_RECEIVE_OBJECT: u64 = 3;
// Represents the case where it is trying to receive an object owned by an
// account.
const E_ACCOUNT_CANNOT_RECEIVE_OBJECT: u64 = 5;
Copy link
Contributor

Choose a reason for hiding this comment

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

Should it be 4 instead of 5? In order to maintain logical error numbering

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Number 4 only appears on the Move side, we should take into consideration that also on the rust side

Copy link
Contributor

@Dkwcs Dkwcs left a comment

Choose a reason for hiding this comment

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

LGTM, left minor comments

/// Uniquely identifies a function in a module
pub struct FnInfoKey {
pub fn_name: String,
pub mod_name: String,
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need a module name here? Does it mean that FnInfoKey currently doesn't identify a function uniquely?
Do we have a test that shows the issue?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Does it mean that FnInfoKey currently doesn't identify a function uniquely?

Exactly, this is like this also upstream (but it only affects test attributes in that case)

@miker83z miker83z merged commit 4091901 into vm-lang/aa-auth/8805-beta-feature-branch Jan 26, 2026
39 checks passed
@miker83z miker83z deleted the vm-lang/aa-auth/9862-remove-receive-aa-accounts branch January 26, 2026 13:39
miker83z added a commit that referenced this pull request Jan 26, 2026
# Description of change

Based on this scenario -> #9371 Receiving objects could be used to make
AA TX certificates invalid, even after these were signed by the majority
of validators.

This PR makes so that any TX trying to receive an object owned by an AA
account (i.e., an object having a `AuthenticatorFunctionRef` dynamic
field) would abort execution (a validator could still sign the
certificate, but the execution makes sure that the received objects will
not be received and won't bump the sequence number).

This PR also fixes a small issue related to duplicate function names in
a package.

## Links to any relevant issues

Closes #9371
Fixes #9862 

## 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

---------

Co-authored-by: Dkwcs <pavlo.botnar@gmail.com>
miker83z added a commit that referenced this pull request Jan 26, 2026
# Description of change

Based on this scenario -> #9371 Receiving objects could be used to make
AA TX certificates invalid, even after these were signed by the majority
of validators.

This PR makes so that any TX trying to receive an object owned by an AA
account (i.e., an object having a `AuthenticatorFunctionRef` dynamic
field) would abort execution (a validator could still sign the
certificate, but the execution makes sure that the received objects will
not be received and won't bump the sequence number).

This PR also fixes a small issue related to duplicate function names in
a package.

## Links to any relevant issues

Closes #9371
Fixes #9862 

## 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

---------

Co-authored-by: Dkwcs <pavlo.botnar@gmail.com>
miker83z added a commit that referenced this pull request Jan 26, 2026
# Description of change

Based on this scenario -> #9371 Receiving objects could be used to make
AA TX certificates invalid, even after these were signed by the majority
of validators.

This PR makes so that any TX trying to receive an object owned by an AA
account (i.e., an object having a `AuthenticatorFunctionRef` dynamic
field) would abort execution (a validator could still sign the
certificate, but the execution makes sure that the received objects will
not be received and won't bump the sequence number).

This PR also fixes a small issue related to duplicate function names in
a package.

## Links to any relevant issues

Closes #9371
Fixes #9862 

## 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

---------

Co-authored-by: Dkwcs <pavlo.botnar@gmail.com>
miker83z added a commit that referenced this pull request Jan 27, 2026
# Description of change

Based on this scenario -> #9371 Receiving objects could be used to make
AA TX certificates invalid, even after these were signed by the majority
of validators.

This PR makes so that any TX trying to receive an object owned by an AA
account (i.e., an object having a `AuthenticatorFunctionRef` dynamic
field) would abort execution (a validator could still sign the
certificate, but the execution makes sure that the received objects will
not be received and won't bump the sequence number).

This PR also fixes a small issue related to duplicate function names in
a package.

## Links to any relevant issues

Closes #9371
Fixes #9862 

## 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

---------

Co-authored-by: Dkwcs <pavlo.botnar@gmail.com>
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] Remove Receive ability for AA Account shared objects [AA][e2e] Test the receiving of a gas coin in two separate TXs

8 participants