Skip to content

Commit e851693

Browse files
Primataganymedio
andauthored
fix(features): add allow serialized script args (#382)
## Description <!-- Please include a summary of the change, including which issue it fixes or what feature it adds. Include relevant motivation, context and documentation as appropriate. List dependencies that are required for this change, if any. --> ## How Has This Been Tested? <!-- - Please ensure that the functionality introduced by this change is well tested and verified to work as expected. - Ensure tests cover both happy and unhappy paths. - List and link relevant tests. --> ## Key Areas to Review <!-- - Identify any critical parts of the code that require special attention or understanding. Explain why these parts are crucial to the functionality or architecture of the project. - Point out any areas where complex logic has been implemented. Provide a brief explanation of the logic and your approach to make it easier for reviewers to follow. - Highlight any areas where you are particularly concerned or unsure about the code's impact on the change. This can include potential performance or security issues, or compatibility with existing features. --> ## Type of Change - [x] New feature - [ ] Bug fix - [ ] Breaking change - [ ] Performance improvement - [ ] Refactoring - [ ] Dependency update - [x] Documentation update - [ ] Tests ## Which Components or Systems Does This Change Impact? - [ ] Validator Node - [ ] Full Node (API, Indexer, etc.) - [x] Move/Aptos Virtual Machine - [x] Aptos Framework - [ ] Aptos CLI/SDK - [ ] Developer Infrastructure - [ ] Move Compiler - [ ] Other (specify) ## Checklist - [x] I have read and followed the [CONTRIBUTING](https://github.com/aptos-labs/aptos-core/blob/main/CONTRIBUTING.md) doc - [x] I have performed a self-review of my own code - [x] 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 <!-- Thank you for your contribution! --> --------- Co-authored-by: Andy <17599867+ganymedio@users.noreply.github.com>
1 parent f1b431c commit e851693

2 files changed

Lines changed: 79 additions & 3 deletions

File tree

aptos-move/framework/move-stdlib/doc/features.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,8 @@ return true.
130130
- [Function `default_to_concurrent_fungible_balance_enabled`](#0x1_features_default_to_concurrent_fungible_balance_enabled)
131131
- [Function `get_abort_if_multisig_payload_mismatch_feature`](#0x1_features_get_abort_if_multisig_payload_mismatch_feature)
132132
- [Function `abort_if_multisig_payload_mismatch_enabled`](#0x1_features_abort_if_multisig_payload_mismatch_enabled)
133+
- [Function `get_allow_serialized_script_args_feature`](#0x1_features_get_allow_serialized_script_args_feature)
134+
- [Function `allow_serialized_script_args_enabled`](#0x1_features_allow_serialized_script_args_enabled)
133135
- [Function `get_atomic_bridge_feature`](#0x1_features_get_atomic_bridge_feature)
134136
- [Function `abort_atomic_bridge_enabled`](#0x1_features_abort_atomic_bridge_enabled)
135137
- [Function `get_native_bridge_feature`](#0x1_features_get_native_bridge_feature)
@@ -295,6 +297,17 @@ Lifetime: transient
295297

296298

297299

300+
<a id="0x1_features_ALLOW_SERIALIZED_SCRIPT_ARGS"></a>
301+
302+
Whether to allow serialized script arguments in the transaction payload.
303+
Lifetime: permanent
304+
305+
306+
<pre><code><b>const</b> <a href="features.md#0x1_features_ALLOW_SERIALIZED_SCRIPT_ARGS">ALLOW_SERIALIZED_SCRIPT_ARGS</a>: u64 = 72;
307+
</code></pre>
308+
309+
310+
298311
<a id="0x1_features_APTOS_STD_CHAIN_ID_NATIVES"></a>
299312

300313
Whether the new <code>aptos_stdlib::type_info::chain_id()</code> native for fetching the chain ID is enabled.
@@ -1117,6 +1130,9 @@ Lifetime: transient
11171130

11181131
<a id="0x1_features_TRANSACTION_SIMULATION_ENHANCEMENT"></a>
11191132

1133+
Whether to enhance the transaction simulation with additional checks and features.
1134+
This is needed because of the introduction of new features in transaction simulation.
1135+
Lifetime: transient
11201136

11211137

11221138
<pre><code><b>const</b> <a href="features.md#0x1_features_TRANSACTION_SIMULATION_ENHANCEMENT">TRANSACTION_SIMULATION_ENHANCEMENT</a>: u64 = 78;
@@ -3448,6 +3464,52 @@ We do not expect use from Move, so for now only for documentation purposes here
34483464

34493465

34503466

3467+
</details>
3468+
3469+
<a id="0x1_features_get_allow_serialized_script_args_feature"></a>
3470+
3471+
## Function `get_allow_serialized_script_args_feature`
3472+
3473+
3474+
3475+
<pre><code><b>public</b> <b>fun</b> <a href="features.md#0x1_features_get_allow_serialized_script_args_feature">get_allow_serialized_script_args_feature</a>(): u64
3476+
</code></pre>
3477+
3478+
3479+
3480+
<details>
3481+
<summary>Implementation</summary>
3482+
3483+
3484+
<pre><code><b>public</b> <b>fun</b> <a href="features.md#0x1_features_get_allow_serialized_script_args_feature">get_allow_serialized_script_args_feature</a>(): u64 { <a href="features.md#0x1_features_ALLOW_SERIALIZED_SCRIPT_ARGS">ALLOW_SERIALIZED_SCRIPT_ARGS</a> }
3485+
</code></pre>
3486+
3487+
3488+
3489+
</details>
3490+
3491+
<a id="0x1_features_allow_serialized_script_args_enabled"></a>
3492+
3493+
## Function `allow_serialized_script_args_enabled`
3494+
3495+
3496+
3497+
<pre><code><b>public</b> <b>fun</b> <a href="features.md#0x1_features_allow_serialized_script_args_enabled">allow_serialized_script_args_enabled</a>(): bool
3498+
</code></pre>
3499+
3500+
3501+
3502+
<details>
3503+
<summary>Implementation</summary>
3504+
3505+
3506+
<pre><code><b>public</b> <b>fun</b> <a href="features.md#0x1_features_allow_serialized_script_args_enabled">allow_serialized_script_args_enabled</a>(): bool <b>acquires</b> <a href="features.md#0x1_features_Features">Features</a> {
3507+
<a href="features.md#0x1_features_is_enabled">is_enabled</a>(<a href="features.md#0x1_features_ALLOW_SERIALIZED_SCRIPT_ARGS">ALLOW_SERIALIZED_SCRIPT_ARGS</a>)
3508+
}
3509+
</code></pre>
3510+
3511+
3512+
34513513
</details>
34523514

34533515
<a id="0x1_features_get_atomic_bridge_feature"></a>

aptos-move/framework/move-stdlib/sources/configs/features.move

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ module std::features {
267267
}
268268

269269
/// Whether we refund storage costs to the user upon deletion
270-
///
270+
///
271271
/// Lifetime: transient
272272
const STORAGE_DELETION_REFUND: u64 = 28;
273273

@@ -593,6 +593,20 @@ module std::features {
593593
is_enabled(ABORT_IF_MULTISIG_PAYLOAD_MISMATCH)
594594
}
595595

596+
/// Whether to allow serialized script arguments in the transaction payload.
597+
/// Lifetime: permanent
598+
const ALLOW_SERIALIZED_SCRIPT_ARGS: u64 = 72;
599+
600+
public fun get_allow_serialized_script_args_feature(): u64 { ALLOW_SERIALIZED_SCRIPT_ARGS }
601+
602+
public fun allow_serialized_script_args_enabled(): bool acquires Features {
603+
is_enabled(ALLOW_SERIALIZED_SCRIPT_ARGS)
604+
}
605+
606+
/// Whether to enhance the transaction simulation with additional checks and features.
607+
/// This is needed because of the introduction of new features in transaction simulation.
608+
/// Lifetime: transient
609+
596610
const TRANSACTION_SIMULATION_ENHANCEMENT: u64 = 78;
597611
/// Whether the Atomic bridge is available
598612
/// Lifetime: transient
@@ -606,9 +620,9 @@ module std::features {
606620
true
607621
}
608622

609-
610623
/// Whether the Atomic bridge is available
611624
/// Lifetime: transient
625+
/// Deprecated in favor of `ALLOW_SERIALIZED_SCRIPT_ARGS` as feature flag 72
612626
const NATIVE_BRIDGE: u64 = 72;
613627

614628
#[deprecated]
@@ -779,7 +793,7 @@ module std::features {
779793
is_enabled(DISTRIBUTE_TRANSACTION_FEE)
780794
}
781795

782-
/// Whether the staking rewards are mint (diseable) or withdraw from the gouverned gas pool treasury (enable).
796+
/// Whether the staking rewards are mint (diseable) or withdraw from the gouverned gas pool treasury (enable).
783797
///
784798
/// Lifetime: permanent
785799
const STAKE_REWARD_USING_TREASURY: u64 = 224;

0 commit comments

Comments
 (0)