Skip to content

Remove resource access control - #410

Open
fEst1ck wants to merge 11 commits into
movement-network:move-rebase-e33from
fEst1ck:zekun/remove-rac
Open

Remove resource access control#410
fEst1ck wants to merge 11 commits into
movement-network:move-rebase-e33from
fEst1ck:zekun/remove-rac

Conversation

@fEst1ck

@fEst1ck fEst1ck commented Aug 4, 2026

Copy link
Copy Markdown

Description

Removes the Move VM resource access control (RAC) feature end to end, since it was never enabled on any Movement network (feature flag 75 is off on mainnet and testnet, so no on-chain module carries access specifiers):

  • Parser / compiler / model: remove access-specifier syntax (reads/writes/pure), the expansion-AST and move-model representations, and file-format generation support.
  • Move VM runtime: remove access_control.rs, runtime_access_specifier.rs, and the access-specifier loader. The dynamic reentrancy check on borrow_global/exists/move_from/move_to is retained via check_resource_access.
  • Bytecode verifier: unconditionally reject any module or script carrying access specifiers (previously gated on enable_resource_access_control, now deprecated to _enable_resource_access_control). Rejection reuses StatusCode::FEATURE_NOT_ENABLED, matching the old flag-off behavior bit for bit.
  • Feature flag: ENABLE_RESOURCE_ACCESS_CONTROL renamed to _DEPRECATED_ENABLE_RESOURCE_ACCESS_CONTROL, keeping discriminant 75 so the on-chain bitset layout is unchanged; the release builder's YAML-facing name is preserved so existing proposals still parse.
  • v2 reference safety: calls to acquires-declaring functions are now rejected on any borrow of the global (previously only mutable borrows) — strictly stricter, and compiler-side only.
  • move-asm / proptest: stop emitting/generating access specifiers, since the verifier now rejects them.

How Has This Been Tested?

  • New verifier unit tests covering both the module and script rejection paths, with negative controls so the assertions cannot pass on an unrelated defect in the fixtures: third_party/move/move-bytecode-verifier/bytecode-verifier-tests/src/unit_tests/access_specifier_tests.rs
  • Regenerated compiler-v2 .exp baselines for access-specifier sources, which now report parse/check errors.
  • Removed the RAC transactional tests (transactional-tests/tests/no-v1-comparison/access_control/) and the runtime access-specifier proptests, which exercise deleted code.
  • Updated aptos-move/e2e-move-tests/src/tests/move_feature_gating.rs for the removed gating.
  • Verified against live chain state that feature 75 is disabled on Movement mainnet and testnet, so no deployed module can carry access specifiers and observable on-chain behavior is unchanged.

Key Areas to Review

  • Verifier rejection completeness (third_party/move/move-bytecode-verifier/src/features.rs, verifier.rs): FeatureVerifier runs right after bounds checking in both verify_module_with_config and verify_script_with_config, checking every function handle plus the script-level specifier field. This is the sole gate keeping specifier-carrying bytecode away from a runtime that no longer understands it.
  • Reentrancy check retention (third_party/move/move-vm/runtime/src/interpreter.rs): the old check_access helper mixed RAC enforcement with the resource reentrancy check; only the RAC half is removed. All four global-storage opcodes still call check_resource_access.
  • Feature-flag/BCS compatibility (types/src/on_chain_config/aptos_features.rs, aptos-move/aptos-release-builder/src/components/feature_flags.rs): discriminant 75 is kept explicitly and the release-builder mapping is preserved in both directions; VerifierConfig keeps the (renamed) field so its serialized layout — used as a node-local cache key — is unchanged.
  • v2 reference-safety tightening (third_party/move/move-compiler-v2/src/pipeline/reference_safety/reference_safety_processor_v2.rs, _v3.rs): confirm the any-borrow rejection matches the bytecode verifier's global-safety model.

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)

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

fEst1ck and others added 11 commits July 24, 2026 02:07
Replace access specifiers with declared_acquires (legacy annotations) and
acquired_structs (inferred); sourcifier prefers the inferred set so
decompiled bytecode keeps its acquires. Adds regression tests for the v2
reference safety processor.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Delete tests using the removed access specifier syntax along with the
now-empty checking-lang-v2.5 config, and regenerate baselines for the new
acquires dump/sourcified output and tighter error spans. The sourcifier no
longer prints inferred acquires on inline functions.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Matches the v3 processor and the bytecode verifier; previously only mutable
borrows were flagged, letting unsound code reach bytecode verification.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Deprecate `enable_resource_access_control` to `_enable_resource_access_control`,
hardcoded false and no longer read: access specifiers are rejected regardless of
the on-chain flag, which is now only used to warn that it is ignored.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Covers the module and script rejection paths, with negative controls so the
assertions cannot pass on an unrelated defect in the fixtures.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Resource access control has been removed, so the flag no longer enables
anything; new chains should not turn it on.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Rename the flag to _DEPRECATED_ENABLE_RESOURCE_ACCESS_CONTROL, keeping
discriminant 75 so the on-chain bitset is unaffected. The release builder's
YAML-facing name is left unchanged so existing proposals still parse.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The assembler no longer copies specifiers from imported function handles, and
the proptest generators no longer produce them, since the verifier now rejects
any bytecode carrying them.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@fEst1ck
fEst1ck marked this pull request as ready for review August 4, 2026 14:22
sig_checker_v2_fix_function_signatures,
enable_enum_types,
enable_resource_access_control,
_enable_resource_access_control: false,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Can we just remove this?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

The comment of the structure says

/// Configuration for the bytecode verifier.
///
/// Always add new fields to the end, as we rely on the hash or serialized bytes of config to
/// detect if it has changed (e.g., new feature flag was enabled). Also, do not delete existing
/// fields, or change the type of existing field.
#[derive(Debug, Clone, Eq, PartialEq, Serialize)]
pub struct VerifierConfig {

Though it seems to me it's removable.

verifier.verify_signatures()?;
verifier.verify_function_handles()?;
if !config.enable_resource_access_control && script.access_specifiers.is_some() {
if script.access_specifiers.is_some() {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

can we remove script.access_specifiers?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

This is part of the file format already enabled on-chain, so we'd better keep it but ignore the RAC.

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