Skip to content

Commit 7f3f166

Browse files
authored
Added the SUPRA_COUNT_FAILED_PROPOSALS flag (#273)
1 parent b03562e commit 7f3f166

File tree

4 files changed

+88
-4
lines changed

4 files changed

+88
-4
lines changed

aptos-move/aptos-release-builder/src/components/feature_flags.rs

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ pub enum FeatureFlag {
126126
SupraAutomationPayloadGasCheck,
127127
PrivatePoll,
128128
SupraAutomationTaskSync,
129+
SupraCountFailedProposals,
129130
}
130131

131132
fn generate_features_blob(writer: &CodeWriter, data: &[u64]) {
@@ -323,9 +324,14 @@ impl From<FeatureFlag> for AptosFeatureFlag {
323324
},
324325
FeatureFlag::SupraNativeAutomation => AptosFeatureFlag::SUPRA_NATIVE_AUTOMATION,
325326
FeatureFlag::SupraEthTrie => AptosFeatureFlag::SUPRA_ETH_TRIE,
326-
FeatureFlag::SupraAutomationPayloadGasCheck => AptosFeatureFlag::SUPRA_AUTOMATION_PAYLOAD_GAS_CHECK,
327+
FeatureFlag::SupraAutomationPayloadGasCheck => {
328+
AptosFeatureFlag::SUPRA_AUTOMATION_PAYLOAD_GAS_CHECK
329+
},
327330
FeatureFlag::PrivatePoll => AptosFeatureFlag::PRIVATE_POLL,
328331
FeatureFlag::SupraAutomationTaskSync => AptosFeatureFlag::SUPRA_AUTOMATION_TASK_SYNC,
332+
FeatureFlag::SupraCountFailedProposals => {
333+
AptosFeatureFlag::SUPRA_COUNT_FAILED_PROPOSALS
334+
},
329335
}
330336
}
331337
}
@@ -451,10 +457,15 @@ impl From<AptosFeatureFlag> for FeatureFlag {
451457
FeatureFlag::AbortIfMultisigPayloadMismatch
452458
},
453459
AptosFeatureFlag::SUPRA_NATIVE_AUTOMATION => FeatureFlag::SupraNativeAutomation,
454-
AptosFeatureFlag::SUPRA_ETH_TRIE=> FeatureFlag::SupraEthTrie,
455-
AptosFeatureFlag::SUPRA_AUTOMATION_PAYLOAD_GAS_CHECK => FeatureFlag::SupraAutomationPayloadGasCheck,
460+
AptosFeatureFlag::SUPRA_ETH_TRIE => FeatureFlag::SupraEthTrie,
461+
AptosFeatureFlag::SUPRA_AUTOMATION_PAYLOAD_GAS_CHECK => {
462+
FeatureFlag::SupraAutomationPayloadGasCheck
463+
},
456464
AptosFeatureFlag::PRIVATE_POLL => FeatureFlag::PrivatePoll,
457465
AptosFeatureFlag::SUPRA_AUTOMATION_TASK_SYNC => FeatureFlag::SupraAutomationTaskSync,
466+
AptosFeatureFlag::SUPRA_COUNT_FAILED_PROPOSALS => {
467+
FeatureFlag::SupraCountFailedProposals
468+
},
458469
}
459470
}
460471
}

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

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,8 @@ return true.
139139
- [Function `supra_private_poll_enabled`](#0x1_features_supra_private_poll_enabled)
140140
- [Function `get_supra_automation_task_sync_feature`](#0x1_features_get_supra_automation_task_sync_feature)
141141
- [Function `supra_automation_task_sync_enabled`](#0x1_features_supra_automation_task_sync_enabled)
142+
- [Function `get_supra_count_failed_proposals_feature`](#0x1_features_get_supra_count_failed_proposals_feature)
143+
- [Function `supra_count_failed_proposals_enabled`](#0x1_features_supra_count_failed_proposals_enabled)
142144
- [Function `change_feature_flags`](#0x1_features_change_feature_flags)
143145
- [Function `change_feature_flags_internal`](#0x1_features_change_feature_flags_internal)
144146
- [Function `change_feature_flags_for_next_epoch`](#0x1_features_change_feature_flags_for_next_epoch)
@@ -901,6 +903,16 @@ Lifetime: transient
901903

902904

903905

906+
<a id="0x1_features_SUPRA_COUNT_FAILED_PROPOSALS"></a>
907+
908+
Whether the automation task sync on block basis is enabled.
909+
910+
911+
<pre><code><b>const</b> <a href="features.md#0x1_features_SUPRA_COUNT_FAILED_PROPOSALS">SUPRA_COUNT_FAILED_PROPOSALS</a>: u64 = 93;
912+
</code></pre>
913+
914+
915+
904916
<a id="0x1_features_SUPRA_ETH_TRIE"></a>
905917

906918
Whether the APIs related to the eth_trie feature are enabled.
@@ -3543,6 +3555,54 @@ Lifetime: transient
35433555

35443556

35453557

3558+
</details>
3559+
3560+
<a id="0x1_features_get_supra_count_failed_proposals_feature"></a>
3561+
3562+
## Function `get_supra_count_failed_proposals_feature`
3563+
3564+
3565+
3566+
<pre><code><b>public</b> <b>fun</b> <a href="features.md#0x1_features_get_supra_count_failed_proposals_feature">get_supra_count_failed_proposals_feature</a>(): u64
3567+
</code></pre>
3568+
3569+
3570+
3571+
<details>
3572+
<summary>Implementation</summary>
3573+
3574+
3575+
<pre><code><b>public</b> <b>fun</b> <a href="features.md#0x1_features_get_supra_count_failed_proposals_feature">get_supra_count_failed_proposals_feature</a>(): u64 {
3576+
<a href="features.md#0x1_features_SUPRA_COUNT_FAILED_PROPOSALS">SUPRA_COUNT_FAILED_PROPOSALS</a>
3577+
}
3578+
</code></pre>
3579+
3580+
3581+
3582+
</details>
3583+
3584+
<a id="0x1_features_supra_count_failed_proposals_enabled"></a>
3585+
3586+
## Function `supra_count_failed_proposals_enabled`
3587+
3588+
3589+
3590+
<pre><code><b>public</b> <b>fun</b> <a href="features.md#0x1_features_supra_count_failed_proposals_enabled">supra_count_failed_proposals_enabled</a>(): bool
3591+
</code></pre>
3592+
3593+
3594+
3595+
<details>
3596+
<summary>Implementation</summary>
3597+
3598+
3599+
<pre><code><b>public</b> <b>fun</b> <a href="features.md#0x1_features_supra_count_failed_proposals_enabled">supra_count_failed_proposals_enabled</a>(): bool <b>acquires</b> <a href="features.md#0x1_features_Features">Features</a> {
3600+
<a href="features.md#0x1_features_is_enabled">is_enabled</a>(<a href="features.md#0x1_features_SUPRA_COUNT_FAILED_PROPOSALS">SUPRA_COUNT_FAILED_PROPOSALS</a>)
3601+
}
3602+
</code></pre>
3603+
3604+
3605+
35463606
</details>
35473607

35483608
<a id="0x1_features_change_feature_flags"></a>

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -727,6 +727,17 @@ module std::features {
727727
is_enabled(SUPRA_AUTOMATION_TASK_SYNC)
728728
}
729729

730+
/// Whether the automation task sync on block basis is enabled.
731+
const SUPRA_COUNT_FAILED_PROPOSALS: u64 = 93;
732+
733+
public fun get_supra_count_failed_proposals_feature(): u64 {
734+
SUPRA_COUNT_FAILED_PROPOSALS
735+
}
736+
737+
public fun supra_count_failed_proposals_enabled(): bool acquires Features {
738+
is_enabled(SUPRA_COUNT_FAILED_PROPOSALS)
739+
}
740+
730741
// ============================================================================================
731742
// Feature Flag Implementation
732743

types/src/on_chain_config/aptos_features.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,11 @@ pub enum FeatureFlag {
8989
// Keeping 16 bit reserved to have graceful updated from aptos-mainstream in case of new flags have been added
9090
// Ends up in 11th byte, 0th bit
9191
SUPRA_NATIVE_AUTOMATION = 88,
92-
SUPRA_ETH_TRIE= 89,
92+
SUPRA_ETH_TRIE = 89,
9393
SUPRA_AUTOMATION_PAYLOAD_GAS_CHECK = 90,
9494
PRIVATE_POLL = 91,
9595
SUPRA_AUTOMATION_TASK_SYNC = 92,
96+
SUPRA_COUNT_FAILED_PROPOSALS = 93,
9697
}
9798

9899
impl FeatureFlag {
@@ -162,6 +163,7 @@ impl FeatureFlag {
162163
FeatureFlag::SUPRA_AUTOMATION_PAYLOAD_GAS_CHECK,
163164
FeatureFlag::PRIVATE_POLL,
164165
FeatureFlag::SUPRA_AUTOMATION_TASK_SYNC,
166+
FeatureFlag::SUPRA_COUNT_FAILED_PROPOSALS,
165167
]
166168
}
167169
}

0 commit comments

Comments
 (0)