Skip to content

[multisig] Add script payload support#16778

Open
gregnazario wants to merge 8 commits intoaptos-labs:mainfrom
gregnazario:multisig-script
Open

[multisig] Add script payload support#16778
gregnazario wants to merge 8 commits intoaptos-labs:mainfrom
gregnazario:multisig-script

Conversation

@gregnazario
Copy link
Contributor

@gregnazario gregnazario commented Jun 5, 2025

Description

Needs an AIP and a feature flag.

This allows for script payloads in multisig. Testing in progress.

How Has This Been Tested?

Key Areas to Review

Type of Change

  • New feature
  • Bug fix
  • Breaking change
  • Performance improvement
  • Refactoring
  • Dependency update
  • Documentation update
  • Tests

Which Components or Systems Does This Change Impact?

  • Validator Node
  • Full Node (API, Indexer, etc.)
  • Move/Aptos Virtual Machine
  • Aptos Framework
  • Aptos CLI/SDK
  • Developer Infrastructure
  • Move Compiler
  • Other (specify)

Checklist

  • I have read and followed the CONTRIBUTING doc
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I identified and added all stakeholders and component owners affected by this change as reviewers
  • I tested both happy and unhappy path of the functionality
  • I have made corresponding changes to the documentation

Note

Adds script payload support for multisig transactions across types, API validation, VM execution, indexer/proto, and tests.

  • Multisig Script Payload Support
    • Extend MultisigTransactionPayload with Script/ScriptPayload in types, API schemas, and protobufs.
    • Update converters (api/types, indexer-grpc, protobuf serde) to map script payloads to/from wire/GRPC models.
  • API
    • Validate multisig Script payloads via validate_script_payload_format and accept them in transaction submission.
    • Generate function stats key for Multisig::Script.
  • VM
    • Implement multisig script execution path: execute_multisig_script, integrate into execute_multisig_transaction.
    • Allow serialized script args when feature-enabled; refactor validate_and_execute_script signature; switch to AptosCodeStorage in multisig path.
  • Transaction Filters
    • Ensure filters continue to match only entry function payloads; skip multisig script payloads where appropriate.
  • Tests
    • Add test_multisig_script_transaction_with_payload_succeeds and helper construct_multisig_txn_script_payload.
    • Minor typo fix in a test comment.

Written by Cursor Bugbot for commit 9182862. This will update automatically on new commits. Configure here.

@github-actions
Copy link
Contributor

This issue is stale because it has been open 45 days with no activity. Remove the stale label, comment or push a commit - otherwise this will be closed in 15 days.

#[oai(one_of, discriminator_name = "type", rename_all = "snake_case")]
pub enum MultisigTransactionPayload {
EntryFunctionPayload(EntryFunctionPayload),
ScriptPayload(ScriptPayload),
Copy link
Contributor

Choose a reason for hiding this comment

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

Why adding it here as well? We can just move to the new format, that supports orderless as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For existing multisig providers, it's a lot less work to just use the existing rails.

Copy link
Contributor

Choose a reason for hiding this comment

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

with support in the SDK, is the work any different?

and even if they are creating manually, they can just fully switch to the new format (i.e. even for entry functions), so they don't need any iffs in their code.

this is a good time for them to support orderless transactions? otherwise they'll need to switch again later?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Orderless transactions can be significantly more expensive than non-orderless transactions, and I suspect that it is mostly unnecessary to be used with Multisig transactions.

SDK requires you to basically build some parts for the payload, so I suspect it may change the flows significantly depending on the language SDK used.

@github-actions
Copy link
Contributor

This issue is stale because it has been open 45 days with no activity. Remove the stale label, comment or push a commit - otherwise this will be closed in 15 days.

@github-actions github-actions bot added the Stale label Dec 19, 2025
@github-actions github-actions bot closed this Jan 4, 2026
@gregnazario
Copy link
Contributor Author

@cursoragent revive this, rebase, and add significant testing for multisig scripts

@gregnazario gregnazario reopened this Feb 6, 2026
@gregnazario
Copy link
Contributor Author

@cursoragent rebase and add more testing

@gregnazario gregnazario removed the Stale label Feb 7, 2026
gregnazario and others added 2 commits February 7, 2026 08:32
- Add 10 new test functions (30 test cases) for script-based multisig:
  simulation, payload hash, matching/mismatching payloads
- Add test context helpers: simulate_multisig_script_transaction,
  execute_multisig_transaction_with_script_payload
- Remove FEATURE_UNDER_GATING blocks that prevented script payloads
  in multisig transactions (aptos_vm, transaction_validation)
- Fix V1 payload format conversion to support Script in multisig

Co-authored-by: Cursor <cursoragent@cursor.com>
- Add CreateScriptTransaction command to propose multisig transactions
  with Move script payloads (source or pre-compiled bytecode)
- Add ExecuteWithScriptPayload command to execute multisig proposals
  that stored only a payload hash, providing the script at execution
- Add VerifyScriptProposal command to verify script payload matches
  on-chain proposal hash
- Add create_multisig_script_payload helper to ScriptFunctionArguments
- Derive Debug on CompileScriptFunction and FrameworkPackageArgs

Co-authored-by: Cursor <cursoragent@cursor.com>
- Fix nightly rustfmt formatting in transactions.rs and account/mod.rs
- Add MultisigTransactionPayload trace_type to generate-format corpus
  for api, aptos, and consensus registries
- Add Script variant to consensus.yaml staged format file

Co-authored-by: Cursor <cursoragent@cursor.com>
@gregnazario gregnazario enabled auto-merge (squash) February 8, 2026 04:03
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 8, 2026

✅ Forge suite compat success on 4adc789fc437d24d20d46d2b38fc3a81cd35d2b9 ==> 060c92e19bf5eaa891083f58c4a88678e17a23f1

Compatibility test results for 4adc789fc437d24d20d46d2b38fc3a81cd35d2b9 ==> 060c92e19bf5eaa891083f58c4a88678e17a23f1 (PR)
1. Check liveness of validators at old version: 4adc789fc437d24d20d46d2b38fc3a81cd35d2b9
compatibility::simple-validator-upgrade::liveness-check : committed: 13414.44 txn/s, latency: 2593.45 ms, (p50: 2700 ms, p70: 2900, p90: 3300 ms, p99: 3600 ms), latency samples: 438480
2. Upgrading first Validator to new version: 060c92e19bf5eaa891083f58c4a88678e17a23f1
compatibility::simple-validator-upgrade::single-validator-upgrade : committed: 6093.83 txn/s, latency: 5543.39 ms, (p50: 6100 ms, p70: 6200, p90: 6400 ms, p99: 6500 ms), latency samples: 209360
3. Upgrading rest of first batch to new version: 060c92e19bf5eaa891083f58c4a88678e17a23f1
compatibility::simple-validator-upgrade::half-validator-upgrade : committed: 6095.48 txn/s, latency: 5551.09 ms, (p50: 6100 ms, p70: 6200, p90: 6300 ms, p99: 6500 ms), latency samples: 211120
4. upgrading second batch to new version: 060c92e19bf5eaa891083f58c4a88678e17a23f1
compatibility::simple-validator-upgrade::rest-validator-upgrade : committed: 10492.32 txn/s, latency: 3070.02 ms, (p50: 2900 ms, p70: 3600, p90: 4200 ms, p99: 5100 ms), latency samples: 346160
5. check swarm health
Compatibility test for 4adc789fc437d24d20d46d2b38fc3a81cd35d2b9 ==> 060c92e19bf5eaa891083f58c4a88678e17a23f1 passed
Test Ok

@github-actions
Copy link
Contributor

github-actions bot commented Feb 8, 2026

✅ Forge suite realistic_env_max_load success on 060c92e19bf5eaa891083f58c4a88678e17a23f1

two traffics test: inner traffic : committed: 13565.72 txn/s, latency: 2776.84 ms, (p50: 2700 ms, p70: 2900, p90: 3000 ms, p99: 3600 ms), latency samples: 5052680
two traffics test : committed: 100.00 txn/s, latency: 734.20 ms, (p50: 700 ms, p70: 800, p90: 900 ms, p99: 900 ms), latency samples: 1720
Latency breakdown for phase 0: ["MempoolToBlockCreation: max: 2.251, avg: 2.188", "ConsensusProposalToOrdered: max: 0.169, avg: 0.166", "ConsensusOrderedToCommit: max: 0.046, avg: 0.042", "ConsensusProposalToCommit: max: 0.214, avg: 0.208"]
Max non-epoch-change gap was: 0 rounds at version 0 (avg 0.00) [limit 4], 0.69s no progress at version 4848214 (avg 0.07s) [limit 15].
Max epoch-change gap was: 0 rounds at version 0 (avg 0.00) [limit 4], 0.28s no progress at version 2259315 (avg 0.28s) [limit 16].
Test Ok

@github-actions
Copy link
Contributor

github-actions bot commented Feb 8, 2026

✅ Forge suite framework_upgrade success on 4adc789fc437d24d20d46d2b38fc3a81cd35d2b9 ==> 060c92e19bf5eaa891083f58c4a88678e17a23f1

Forge report malformed: Expecting ',' delimiter: line 3 column 6 (char 22)
'{\n  "metrics": [\n[2026-02-08T04:50:07Z INFO  aptos_forge::report] Test Ok\n    {\n      "test_name": "framework_upgrade::framework-upgrade::full-framework-upgrade",\n      "metric": "submitted_txn",\n      "value": 212980.0\n    },\n    {\n      "test_name": "framework_upgrade::framework-upgrade::full-framework-upgrade",\n      "metric": "expired_txn",\n      "value": 600.0\n    },\n    {\n      "test_name": "framework_upgrade::framework-upgrade::full-framework-upgrade",\n      "metric": "avg_tps",\n      "value": 2367.9553265871464\n    },\n    {\n      "test_name": "framework_upgrade::framework-upgrade::full-framework-upgrade",\n      "metric": "avg_latency",\n      "value": 1237.76488369903\n    },\n    {\n      "test_name": "framework_upgrade::framework-upgrade::full-framework-upgrade",\n      "metric": "p50_latency",\n      "value": 1200.0\n    },\n    {\n      "test_name": "framework_upgrade::framework-upgrade::full-framework-upgrade",\n      "metric": "p90_latency",\n      "value": 1800.0\n    },\n    {\n      "test_name": "framework_upgrade::framework-upgrade::full-framework-upgrade",\n      "metric": "p99_latency",\n      "value": 2400.0\n    },\n    {\n      "test_name": "framework_upgrade::framework-upgrade::full-framework-upgrade",\n      "metric": "submitted_txn",\n      "value": 201062.0\n    },\n    {\n      "test_name": "framework_upgrade::framework-upgrade::full-framework-upgrade",\n      "metric": "expired_txn",\n      "value": 760.0\n    },\n    {\n      "test_name": "framework_upgrade::framework-upgrade::full-framework-upgrade",\n      "metric": "avg_tps",\n      "value": 2264.656857938065\n    },\n    {\n      "test_name": "framework_upgrade::framework-upgrade::full-framework-upgrade",\n      "metric": "avg_latency",\n      "value": 1327.3274705195156\n    },\n    {\n      "test_name": "framework_upgrade::framework-upgrade::full-framework-upgrade",\n      "metric": "p50_latency",\n      "value": 1200.0\n    },\n    {\n      "test_name": "framework_upgrade::framework-upgrade::full-framework-upgrade",\n      "metric": "p90_latency",\n      "value": 1800.0\n    },\n    {\n      "test_name": "framework_upgrade::framework-upgrade::full-framework-upgrade",\n      "metric": "p99_latency",\n      "value": 2700.0\n    },\n    {\n      "test_name": "framework_upgrade::framework-upgrade::full-framework-upgrade",\n      "metric": "submitted_txn",\n      "value": 133541.0\n    },\n    {\n      "test_name": "framework_upgrade::framework-upgrade::full-framework-upgrade",\n      "metric": "expired_txn",\n      "value": 380.0\n    },\n    {\n      "test_name": "framework_upgrade::framework-upgrade::full-framework-upgrade",\n      "metric": "avg_tps",\n      "value": 1495.6740302973994\n    },\n    {\n      "test_name": "framework_upgrade::framework-upgrade::full-framework-upgrade",\n      "metric": "avg_latency",\n      "value": 2005.4571083124938\n    },\n    {\n      "test_name": "framework_upgrade::framework-upgrade::full-framework-upgrade",\n      "metric": "p50_latency",\n      "value": 1200.0\n    },\n    {\n      "test_name": "framework_upgrade::framework-upgrade::full-framework-upgrade",\n      "metric": "p90_latency",\n      "value": 1800.0\n    },\n    {\n      "test_name": "framework_upgrade::framework-upgrade::full-framework-upgrade",\n      "metric": "p99_latency",\n      "value": 11800.0\n    }\n  ],\n  "text": "Compatibility test results for 4adc789fc437d24d20d46d2b38fc3a81cd35d2b9 ==> 060c92e19bf5eaa891083f58c4a88678e17a23f1 (PR)\\nUpgrade the nodes to version: 060c92e19bf5eaa891083f58c4a88678e17a23f1\\nframework_upgrade::framework-upgrade::full-framework-upgrade : committed: 2367.96 txn/s, submitted: 2374.65 txn/s, failed submission: 6.69 txn/s, expired: 6.69 txn/s, latency: 1237.76 ms, (p50: 1200 ms, p70: 1200, p90: 1800 ms, p99: 2400 ms), latency samples: 212380\\nframework_upgrade::framework-upgrade::full-framework-upgrade : committed: 2264.66 txn/s, submitted: 2273.25 txn/s, failed submission: 8.59 txn/s, expired: 8.59 txn/s, latency: 1327.33 ms, (p50: 1200 ms, p70: 1500, p90: 1800 ms, p99: 2700 ms), latency samples: 200302\\n5. check swarm health\\nCompatibility test for 4adc789fc437d24d20d46d2b38fc3a81cd35d2b9 ==> 060c92e19bf5eaa891083f58c4a88678e17a23f1 passed\\nUpgrade the remaining nodes to version: 060c92e19bf5eaa891083f58c4a88678e17a23f1\\nframework_upgrade::framework-upgrade::full-framework-upgrade : committed: 1495.67 txn/s, submitted: 1499.94 txn/s, failed submission: 4.27 txn/s, expired: 4.27 txn/s, latency: 2005.46 ms, (p50: 1200 ms, p70: 1500, p90: 1800 ms, p99: 11800 ms), latency samples: 133161\\nTest Ok"\n}'
Trailing Log Lines:
Compatibility test results for 4adc789fc437d24d20d46d2b38fc3a81cd35d2b9 ==> 060c92e19bf5eaa891083f58c4a88678e17a23f1 (PR)
Upgrade the nodes to version: 060c92e19bf5eaa891083f58c4a88678e17a23f1
framework_upgrade::framework-upgrade::full-framework-upgrade : committed: 2367.96 txn/s, submitted: 2374.65 txn/s, failed submission: 6.69 txn/s, expired: 6.69 txn/s, latency: 1237.76 ms, (p50: 1200 ms, p70: 1200, p90: 1800 ms, p99: 2400 ms), latency samples: 212380
framework_upgrade::framework-upgrade::full-framework-upgrade : committed: 2264.66 txn/s, submitted: 2273.25 txn/s, failed submission: 8.59 txn/s, expired: 8.59 txn/s, latency: 1327.33 ms, (p50: 1200 ms, p70: 1500, p90: 1800 ms, p99: 2700 ms), latency samples: 200302
5. check swarm health
Compatibility test for 4adc789fc437d24d20d46d2b38fc3a81cd35d2b9 ==> 060c92e19bf5eaa891083f58c4a88678e17a23f1 passed
Upgrade the remaining nodes to version: 060c92e19bf5eaa891083f58c4a88678e17a23f1
framework_upgrade::framework-upgrade::full-framework-upgrade : committed: 1495.67 txn/s, submitted: 1499.94 txn/s, failed submission: 4.27 txn/s, expired: 4.27 txn/s, latency: 2005.46 ms, (p50: 1200 ms, p70: 1500, p90: 1800 ms, p99: 11800 ms), latency samples: 133161
Test Ok

=== BEGIN JUNIT ===
<?xml version="1.0" encoding="UTF-8"?>
<testsuites name="forge" tests="1" failures="0" errors="0" uuid="e5882a84-1f35-4c3c-a422-5480257ae5c8">
    <testsuite name="local" tests="1" disabled="0" errors="0" failures="0">
        <testcase name="framework_upgrade::framework-upgrade">
        </testcase>
    </testsuite>
</testsuites>
=== END JUNIT ===
[2026-02-08T04:50:07Z INFO  aptos_forge::backend::k8s::cluster_helper] Deleting namespace forge-framework-upgrade-pr-16778: Some(NamespaceStatus { conditions: None, phase: Some("Terminating") })
[2026-02-08T04:50:07Z INFO  aptos_forge::backend::k8s::cluster_helper] aptos-node resources for Forge removed in namespace: forge-framework-upgrade-pr-16778

test result: ok. 1 passed; 0 soft failed; 0 hard failed; 0 filtered out

Debugging output:
NAME                                         READY   STATUS      RESTARTS   AGE
aptos-node-0-validator-0                     1/1     Running     0          11m
aptos-node-1-validator-0                     1/1     Running     0          11m
aptos-node-2-validator-0                     1/1     Running     0          3m16s
aptos-node-3-validator-0                     1/1     Running     0          2m36s
forge-testnet-deployer-mbmgp                 0/1     Completed   0          15m
genesis-aptos-genesis-eforge14c16933-6f9v6   0/1     Completed   0          15m

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants