Skip to content

[compiler] set language version 2.4 and bytecode version v10 as default#19702

Merged
rahxephon89 merged 1 commit into
mainfrom
teng/set-v10-2-4-as-default
May 27, 2026
Merged

[compiler] set language version 2.4 and bytecode version v10 as default#19702
rahxephon89 merged 1 commit into
mainfrom
teng/set-v10-2-4-as-default

Conversation

@rahxephon89

@rahxephon89 rahxephon89 commented May 11, 2026

Copy link
Copy Markdown
Contributor

Description

This PR sets language version 2.4 and bytecode version v10 as default. It follows the same pattern as #18400 (which previously set 2.3 + v9 as default), bumping one version higher.

Release CLI 9.4.0.

Source-level changes:

  • third_party/move/move-binary-format/src/file_format_common.rs: VERSION_DEFAULT V9 → V10; removed VERSION_DEFAULT_LANG_V2_4 (which now equals VERSION_DEFAULT); kept VERSION_DEFAULT_LANG_V2_5 = V10 as the pointer for language versions above the default.
  • third_party/move/move-model/src/metadata.rs: LATEST_STABLE_LANGUAGE_VERSION_VALUE V2.3 → V2.4; V2.4 removed from unstable(); infer_bytecode_version collapses V2.0–V2.4 → VERSION_DEFAULT, V2.5 → VERSION_DEFAULT_LANG_V2_5.
  • crates/aptos/CHANGELOG.md: added an Unreleased entry.

This PR incurs changes to the bytecode version in the results of many tests which output bytecode version info (about 100 .exp / .disassembled goldens across move-asm, transactional-test-runner, and move-vm-transactional-tests), plus the API state-test golden and the cached release bundle (head.mrb).

How Has This Been Tested?

  • Regenerated test baselines and confirmed all three suites pass under the new defaults:
    • RUST_MIN_STACK=42971520 UPBL=1 cargo test -p move-asm --test testsuite — 35 passed
    • RUST_MIN_STACK=42971520 UPBL=1 cargo test -p move-vm-transactional-tests — 931 passed
    • RUST_MIN_STACK=42971520 UPBL=1 cargo test -p move-transactional-test-runner --test tests — 7 passed
  • Rebuilt the cached framework release bundle via cargo run -p aptos-framework -- update-cached-packages and re-ran the API state-test golden under REGENERATE_GOLDENFILES=1 (cargo test -p aptos-api test_get_account_module) — golden bytecode header is now 0xa11ceb0b0a (v10) with embedded language 2.4.
  • Verified no remaining Bytecode version v9 references in .exp / .disassembled / .json files.

Key Areas to Review

  • Make sure no other crates pin VERSION_DEFAULT_LANG_V2_4 (the only references were in move-binary-format and move-model, both updated here).
  • Confirm that broader test suites (e2e-move-tests, aptos-framework, move-compiler-v2) continue to pass against the new defaults under CI.

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

Medium Risk
Changing default language/bytecode versions affects all new CLI compilations and published bytecode shape; risk is mitigated by following the prior stable-default bump pattern but still warrants validation against on-chain max bytecode version and broader CI (framework, e2e, compiler-v2).

Overview
This PR makes Move language 2.4 and bytecode v10 the default for the Aptos CLI (release 9.4.0), following the same pattern as the prior 2.3 / v9 bump.

Compiler defaults: VERSION_DEFAULT moves from v9 to v10 in file_format_common.rs, and the separate VERSION_DEFAULT_LANG_V2_4 mapping is removed because v10 is now the global default. In metadata.rs, 2.4 becomes the latest stable language version (replacing 2.3), 2.4 is no longer treated as unstable, and bytecode inference for 2.0–2.4 all use VERSION_DEFAULT.

User-visible behavior: New compilations without explicit version flags emit v10 bytecode and 2.4 language metadata (e.g. framework guid golden, compile-script hash). Compiler diagnostics for gated 2.4 features now refer to "2.4" instead of "2.4-unstable". An e2e Move test drops public on a struct now that public struct visibility is allowed under the new default.

Baselines: Large mechanical updates to .exp, .disassembled, and API goldens so printed bytecode headers show v10; Cargo.lock reflects the CLI version bump.

Reviewed by Cursor Bugbot for commit ed1d507. Bugbot is set up for automated code reviews on this repo. Configure here.

Copy link
Copy Markdown
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@rahxephon89 rahxephon89 changed the title set v10 and 2.4 as default [compiler] set language version 2.4 and bytecode version v10 as default May 11, 2026
@rahxephon89 rahxephon89 changed the title [compiler] set language version 2.4 and bytecode version v10 as default [compiler][WIP] set language version 2.4 and bytecode version v10 as default May 11, 2026
@rahxephon89 rahxephon89 force-pushed the teng/set-v10-2-4-as-default branch from 5429202 to 299b9f5 Compare May 11, 2026 18:27
@rahxephon89 rahxephon89 marked this pull request as ready for review May 11, 2026 21:49
@rahxephon89 rahxephon89 requested review from a team, 0xmaayan, banool and gregnazario as code owners May 11, 2026 21:49
@rahxephon89 rahxephon89 changed the title [compiler][WIP] set language version 2.4 and bytecode version v10 as default [compiler] set language version 2.4 and bytecode version v10 as default May 11, 2026
@rahxephon89 rahxephon89 force-pushed the teng/set-v10-2-4-as-default branch from 657e796 to de928aa Compare May 12, 2026 05:44
@rahxephon89 rahxephon89 force-pushed the teng/set-v10-2-4-as-default branch from de928aa to 30688b9 Compare May 14, 2026 08:47
@rahxephon89 rahxephon89 force-pushed the teng/set-v10-2-4-as-default branch from 30688b9 to fca83dc Compare May 27, 2026 00:23
@rahxephon89 rahxephon89 force-pushed the teng/set-v10-2-4-as-default branch from fca83dc to ed1d507 Compare May 27, 2026 21:11
@rahxephon89 rahxephon89 enabled auto-merge (squash) May 27, 2026 21:11
@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
Copy Markdown
Contributor

✅ Forge suite realistic_env_max_load success on ed1d507437086ab5b2373b0bea3c13c250c83c1a

two traffics test: inner traffic : committed: 15532.64 txn/s, latency: 1098.44 ms, (p50: 1000 ms, p70: 1100, p90: 1300 ms, p99: 1700 ms), latency samples: 5795420
two traffics test : committed: 99.99 txn/s, latency: 858.21 ms, (p50: 800 ms, p70: 900, p90: 1000 ms, p99: 1700 ms), latency samples: 1740
Latency breakdown for phase 0: ["MempoolToBlockCreation: max: 0.283, avg: 0.246", "ConsensusProposalToOrdered: max: 0.111, avg: 0.108", "ConsensusOrderedToCommit: max: 0.168, avg: 0.150", "ConsensusProposalToCommit: max: 0.267, avg: 0.258"]
Max non-epoch-change gap was: 0 rounds at version 0 (avg 0.00) [limit 4], 0.53s no progress at version 6610597 (avg 0.06s) [limit 15].
Max epoch-change gap was: 0 rounds at version 0 (avg 0.00) [limit 4], 0.25s no progress at version 3054270 (avg 0.25s) [limit 16].
Test Ok

@github-actions

Copy link
Copy Markdown
Contributor

✅ Forge suite compat success on 7d4aeb52496187f2ae9494d2ef82e9360931fc9f ==> ed1d507437086ab5b2373b0bea3c13c250c83c1a

Forge report malformed: Expecting ',' delimiter: line 1 column 6 (char 5)
'[2026-05-27T21:47:17Z INFO  aptos_forge::report] Test Ok\n{\n  "metrics": [\n    {\n      "test_name": "compatibility::simple-validator-upgrade::liveness-check",\n      "metric": "submitted_txn",\n      "value": 487420.0\n    },\n    {\n      "test_name": "compatibility::simple-validator-upgrade::liveness-check",\n      "metric": "expired_txn",\n      "value": 0.0\n    },\n    {\n      "test_name": "compatibility::simple-validator-upgrade::liveness-check",\n      "metric": "avg_tps",\n      "value": 15033.84906077397\n    },\n    {\n      "test_name": "compatibility::simple-validator-upgrade::liveness-check",\n      "metric": "avg_latency",\n      "value": 2280.5732489434163\n    },\n    {\n      "test_name": "compatibility::simple-validator-upgrade::liveness-check",\n      "metric": "p50_latency",\n      "value": 2100.0\n    },\n    {\n      "test_name": "compatibility::simple-validator-upgrade::liveness-check",\n      "metric": "p90_latency",\n      "value": 3400.0\n    },\n    {\n      "test_name": "compatibility::simple-validator-upgrade::liveness-check",\n      "metric": "p99_latency",\n      "value": 4500.0\n    },\n    {\n      "test_name": "compatibility::simple-validator-upgrade::single-validator-upgrade",\n      "metric": "submitted_txn",\n      "value": 208080.0\n    },\n    {\n      "test_name": "compatibility::simple-validator-upgrade::single-validator-upgrade",\n      "metric": "expired_txn",\n      "value": 0.0\n    },\n    {\n      "test_name": "compatibility::simple-validator-upgrade::single-validator-upgrade",\n      "metric": "avg_tps",\n      "value": 6035.854635524821\n    },\n    {\n      "test_name": "compatibility::simple-validator-upgrade::single-validator-upgrade",\n      "metric": "avg_latency",\n      "value": 5599.658496732026\n    },\n    {\n      "test_name": "compatibility::simple-validator-upgrade::single-validator-upgrade",\n      "metric": "p50_latency",\n      "value": 6200.0\n    },\n    {\n      "test_name": "compatibility::simple-validator-upgrade::single-validator-upgrade",\n      "metric": "p90_latency",\n      "value": 6500.0\n    },\n    {\n      "test_name": "compatibility::simple-validator-upgrade::single-validator-upgrade",\n      "metric": "p99_latency",\n      "value": 6800.0\n    },\n    {\n      "test_name": "compatibility::simple-validator-upgrade::half-validator-upgrade",\n      "metric": "submitted_txn",\n      "value": 214600.0\n    },\n    {\n      "test_name": "compatibility::simple-validator-upgrade::half-validator-upgrade",\n      "metric": "expired_txn",\n      "value": 0.0\n    },\n    {\n      "test_name": "compatibility::simple-validator-upgrade::half-validator-upgrade",\n      "metric": "avg_tps",\n      "value": 6246.95624479963\n    },\n    {\n      "test_name": "compatibility::simple-validator-upgrade::half-validator-upgrade",\n      "metric": "avg_latency",\n      "value": 5383.4089422180805\n    },\n    {\n      "test_name": "compatibility::simple-validator-upgrade::half-validator-upgrade",\n      "metric": "p50_latency",\n      "value": 6000.0\n    },\n    {\n      "test_name": "compatibility::simple-validator-upgrade::half-validator-upgrade",\n      "metric": "p90_latency",\n      "value": 6200.0\n    },\n    {\n      "test_name": "compatibility::simple-validator-upgrade::half-validator-upgrade",\n      "metric": "p99_latency",\n      "value": 6200.0\n    },\n    {\n      "test_name": "compatibility::simple-validator-upgrade::rest-validator-upgrade",\n      "metric": "submitted_txn",\n      "value": 322680.0\n    },\n    {\n      "test_name": "compatibility::simple-validator-upgrade::rest-validator-upgrade",\n      "metric": "expired_txn",\n      "value": 0.0\n    },\n    {\n      "test_name": "compatibility::simple-validator-upgrade::rest-validator-upgrade",\n      "metric": "avg_tps",\n      "value": 9889.91157595995\n    },\n    {\n      "test_name": "compatibility::simple-validator-upgrade::rest-validator-upgrade",\n      "metric": "avg_latency",\n      "value": 3410.103870707822\n    },\n    {\n      "test_name": "compatibility::simple-validator-upgrade::rest-validator-upgrade",\n      "metric": "p50_latency",\n      "value": 3600.0\n    },\n    {\n      "test_name": "compatibility::simple-validator-upgrade::rest-validator-upgrade",\n      "metric": "p90_latency",\n      "value": 4000.0\n    },\n    {\n      "test_name": "compatibility::simple-validator-upgrade::rest-validator-upgrade",\n      "metric": "p99_latency",\n      "value": 4200.0\n    }\n  ],\n  "text": "Compatibility test results for 7d4aeb52496187f2ae9494d2ef82e9360931fc9f ==> ed1d507437086ab5b2373b0bea3c13c250c83c1a (PR)\\n1. Check liveness of validators at old version: 7d4aeb52496187f2ae9494d2ef82e9360931fc9f\\ncompatibility::simple-validator-upgrade::liveness-check : committed: 15033.85 txn/s, latency: 2280.57 ms, (p50: 2100 ms, p70: 2500, p90: 3400 ms, p99: 4500 ms), latency samples: 487420\\n2. Upgrading first Validator to new version: ed1d507437086ab5b2373b0bea3c13c250c83c1a\\ncompatibility::simple-validator-upgrade::single-validator-upgrade : committed: 6035.85 txn/s, latency: 5599.66 ms, (p50: 6200 ms, p70: 6400, p90: 6500 ms, p99: 6800 ms), latency samples: 208080\\n3. Upgrading rest of first batch to new version: ed1d507437086ab5b2373b0bea3c13c250c83c1a\\ncompatibility::simple-validator-upgrade::half-validator-upgrade : committed: 6246.96 txn/s, latency: 5383.41 ms, (p50: 6000 ms, p70: 6100, p90: 6200 ms, p99: 6200 ms), latency samples: 214600\\n4. upgrading second batch to new version: ed1d507437086ab5b2373b0bea3c13c250c83c1a\\ncompatibility::simple-validator-upgrade::rest-validator-upgrade : committed: 9889.91 txn/s, latency: 3410.10 ms, (p50: 3600 ms, p70: 3800, p90: 4000 ms, p99: 4200 ms), latency samples: 322680\\n5. check swarm health\\nCompatibility test for 7d4aeb52496187f2ae9494d2ef82e9360931fc9f ==> ed1d507437086ab5b2373b0bea3c13c250c83c1a passed\\nTest Ok"\n}'
Trailing Log Lines:
2. Upgrading first Validator to new version: ed1d507437086ab5b2373b0bea3c13c250c83c1a
compatibility::simple-validator-upgrade::single-validator-upgrade : committed: 6035.85 txn/s, latency: 5599.66 ms, (p50: 6200 ms, p70: 6400, p90: 6500 ms, p99: 6800 ms), latency samples: 208080
3. Upgrading rest of first batch to new version: ed1d507437086ab5b2373b0bea3c13c250c83c1a
compatibility::simple-validator-upgrade::half-validator-upgrade : committed: 6246.96 txn/s, latency: 5383.41 ms, (p50: 6000 ms, p70: 6100, p90: 6200 ms, p99: 6200 ms), latency samples: 214600
4. upgrading second batch to new version: ed1d507437086ab5b2373b0bea3c13c250c83c1a
compatibility::simple-validator-upgrade::rest-validator-upgrade : committed: 9889.91 txn/s, latency: 3410.10 ms, (p50: 3600 ms, p70: 3800, p90: 4000 ms, p99: 4200 ms), latency samples: 322680
5. check swarm health
Compatibility test for 7d4aeb52496187f2ae9494d2ef82e9360931fc9f ==> ed1d507437086ab5b2373b0bea3c13c250c83c1a passed
Test Ok

=== BEGIN JUNIT ===
<?xml version="1.0" encoding="UTF-8"?>
<testsuites name="forge" tests="1" failures="0" errors="0" uuid="c3b666fb-9624-4ada-a965-ba6a4a54b002">
    <testsuite name="compat" tests="1" disabled="0" errors="0" failures="0">
        <testcase name="compatibility::simple-validator-upgrade">
        </testcase>
    </testsuite>
</testsuites>
=== END JUNIT ===
[2026-05-27T21:47:17Z INFO  aptos_forge::backend::k8s::cluster_helper] Deleting namespace forge-compat-pr-19702: Some(NamespaceStatus { conditions: None, phase: Some("Terminating") })
[2026-05-27T21:47:17Z INFO  aptos_forge::backend::k8s::cluster_helper] aptos-node resources for Forge removed in namespace: forge-compat-pr-19702
[2026-05-27T21:47:17Z INFO  ureq::unit] sending request POST http://vmagent-victoria-metrics-agent.victoria-metrics.svc:8429/api/v1/import/prometheus

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          4m39s
aptos-node-1-validator-0                     1/1     Running     0          6m21s
aptos-node-2-validator-0                     1/1     Running     0          2m46s
aptos-node-3-validator-0                     1/1     Running     0          103s
forge-testnet-deployer-88hw9                 0/1     Completed   0          11m
genesis-aptos-genesis-eforged34932ee-8bb85   0/1     Completed   0          10m

@github-actions

Copy link
Copy Markdown
Contributor

✅ Forge suite framework_upgrade success on 7d4aeb52496187f2ae9494d2ef82e9360931fc9f ==> ed1d507437086ab5b2373b0bea3c13c250c83c1a

Compatibility test results for 7d4aeb52496187f2ae9494d2ef82e9360931fc9f ==> ed1d507437086ab5b2373b0bea3c13c250c83c1a (PR)
Upgrade the nodes to version: ed1d507437086ab5b2373b0bea3c13c250c83c1a
framework_upgrade::framework-upgrade::full-framework-upgrade : committed: 2268.65 txn/s, submitted: 2275.37 txn/s, failed submission: 6.73 txn/s, expired: 6.73 txn/s, latency: 1257.50 ms, (p50: 1200 ms, p70: 1300, p90: 1800 ms, p99: 2400 ms), latency samples: 202400
framework_upgrade::framework-upgrade::full-framework-upgrade : committed: 1429.36 txn/s, submitted: 1433.74 txn/s, failed submission: 4.38 txn/s, expired: 4.38 txn/s, latency: 1932.00 ms, (p50: 1200 ms, p70: 1500, p90: 2500 ms, p99: 11500 ms), latency samples: 130520
5. check swarm health
Compatibility test for 7d4aeb52496187f2ae9494d2ef82e9360931fc9f ==> ed1d507437086ab5b2373b0bea3c13c250c83c1a passed
Upgrade the remaining nodes to version: ed1d507437086ab5b2373b0bea3c13c250c83c1a
framework_upgrade::framework-upgrade::full-framework-upgrade : committed: 2301.07 txn/s, submitted: 2307.70 txn/s, failed submission: 6.63 txn/s, expired: 6.63 txn/s, latency: 1217.41 ms, (p50: 1200 ms, p70: 1300, p90: 1800 ms, p99: 2400 ms), latency samples: 208260
Test Ok

@rahxephon89 rahxephon89 merged commit 7f900aa into main May 27, 2026
95 of 105 checks passed
@rahxephon89 rahxephon89 deleted the teng/set-v10-2-4-as-default branch May 27, 2026 21:55
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.

3 participants