Skip to content

Commit 343fd34

Browse files
committed
feat: use aptos-core commit hash with correct prerequisite functions
1 parent e51a8d8 commit 343fd34

File tree

7 files changed

+49
-26
lines changed

7 files changed

+49
-26
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ aptos-framework-head-release = { path = "protocol-units/execution/maptos/framewo
9292
aptos-framework-elsa-release = { path = "protocol-units/execution/maptos/framework/releases/elsa" }
9393
aptos-framework-biarritz-rc1-release = { path = "protocol-units/execution/maptos/framework/releases/biarritz-rc1" }
9494
aptos-framework-pre-l1-merge-release = { path = "protocol-units/execution/maptos/framework/releases/pre-l1-merge" }
95+
aptos-framework-pre-l1-merge-reset-release = { path = "protocol-units/execution/maptos/framework/releases/pre-l1-merge-reset" }
9596
aptos-framework-upgrade-gas-release = { path = "protocol-units/execution/maptos/framework/releases/upgrade-gas" }
9697
aptos-framework-known-release = { path = "protocol-units/execution/maptos/framework/releases/known-release" }
9798
aptos-framework-set-feature-flags-release = { path = "protocol-units/execution/maptos/framework/releases/feature-flags" }

protocol-units/execution/maptos/framework/releases/known-release/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ path = "src/lib.rs"
1616
maptos-framework-release-util = { workspace = true }
1717
aptos-framework-elsa-release = { workspace = true }
1818
aptos-framework-biarritz-rc1-release = { workspace = true }
19+
aptos-framework-pre-l1-merge-release = { workspace = true }
1920
aptos-framework-head-release = { workspace = true }
2021
aptos-framework = { workspace = true }
2122
tokio = { workspace = true }

protocol-units/execution/maptos/framework/releases/known-release/src/lib.rs

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ use std::error;
88
pub enum KnownRelease {
99
Elsa(aptos_framework_elsa_release::cached::gas_upgrade::Elsa),
1010
BiarritzRc1(aptos_framework_biarritz_rc1_release::cached::full::feature_upgrade::BiarritzRc1),
11+
PreL1Merge(aptos_framework_pre_l1_merge_release::cached::full::feature_upgrade::PreL1Merge),
1112
Head(aptos_framework_head_release::Head),
1213
}
1314

@@ -16,6 +17,7 @@ impl Release for KnownRelease {
1617
match self {
1718
KnownRelease::Elsa(elsa) => elsa.release_bundle(),
1819
KnownRelease::BiarritzRc1(biarritz_rc1) => biarritz_rc1.release_bundle(),
20+
KnownRelease::PreL1Merge(pre_l1_merge) => pre_l1_merge.release_bundle(),
1921
KnownRelease::Head(head) => head.release_bundle(),
2022
}
2123
}
@@ -27,23 +29,26 @@ pub enum KnownReleaseError {
2729
InvalidIdentifier(#[source] Box<dyn error::Error + Send + Sync>),
2830
}
2931

30-
/// Implement a method to create a new [KnownRelease] instance from a string.
31-
impl KnownRelease {
32-
pub fn try_new(release: &str) -> Result<Self, KnownReleaseError> {
33-
match release {
34-
"elsa" => Ok(KnownRelease::Elsa(
35-
aptos_framework_elsa_release::cached::gas_upgrade::Elsa::new(),
36-
)),
37-
"biarritz-rc1" => Ok(KnownRelease::BiarritzRc1(
38-
aptos_framework_biarritz_rc1_release::cached::full::feature_upgrade::BiarritzRc1::new(),
39-
)),
40-
"head" => Ok(KnownRelease::Head(aptos_framework_head_release::Head::new())),
41-
_ => Err(KnownReleaseError::InvalidIdentifier(
42-
format!("unknown release string: {}", release).into(),
43-
)
44-
.into()),
32+
/// Implement a method to create a new [KnownRelease] instance from a string.
33+
impl KnownRelease {
34+
pub fn try_new(release: &str) -> Result<Self, KnownReleaseError> {
35+
match release {
36+
"elsa" => Ok(KnownRelease::Elsa(
37+
aptos_framework_elsa_release::cached::gas_upgrade::Elsa::new(),
38+
)),
39+
"biarritz-rc1" => Ok(KnownRelease::BiarritzRc1(
40+
aptos_framework_biarritz_rc1_release::cached::full::feature_upgrade::BiarritzRc1::new(),
41+
)),
42+
"pre-l1-merge" => Ok(KnownRelease::PreL1Merge(
43+
aptos_framework_pre_l1_merge_release::cached::full::feature_upgrade::PreL1Merge::new(),
44+
)),
45+
"head" => Ok(KnownRelease::Head(aptos_framework_head_release::Head::new())),
46+
_ => Err(KnownReleaseError::InvalidIdentifier(
47+
format!("unknown release string: {}", release).into(),
48+
)
49+
.into()),
50+
}
4551
}
46-
}
4752

4853
pub fn head() -> Self {
4954
KnownRelease::Head(aptos_framework_head_release::Head::new())

protocol-units/execution/maptos/framework/releases/pre-l1-merge/build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use maptos_framework_release_util::commit_hash_with_script;
55
commit_hash_with_script!(
66
BiarritzRc1, // Struct name
77
"https://github.com/movementlabsxyz/aptos-core.git", // Repository URL
8-
"edafe2e5ed6ce462fa81d08faf5d5008fa836ca2", // Commit hash
8+
"c5d8d936b7775436ff6c256e10049b4de497c220", // Commit hash
99
6, // Bytecode version
1010
"pre-l1-merge.mrb", // MRB file name
1111
"CACHE_PRE_L1_MERGE_FRAMEWORK_RELEASE" // Cache environment variable
Binary file not shown.

protocol-units/execution/maptos/framework/releases/pre-l1-merge/src/cached.rs

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use aptos_framework_upgrade_gas_release::generate_gas_upgrade_module;
22
use maptos_framework_release_util::mrb_release;
33

4-
mrb_release!(PreL1Merge, BIARRTIZ_RC1, "edafe2e5ed6ce462fa81d08faf5d5008fa836ca2-pre-l1-merge.mrb");
4+
mrb_release!(PreL1Merge, BIARRTIZ_RC1, "c5d8d936b7775436ff6c256e10049b4de497c220-pre-l1-merge.mrb");
55

66
generate_gas_upgrade_module!(gas_upgrade, PreL1Merge, {
77
let mut gas_parameters = AptosGasParameters::initial();
@@ -24,7 +24,7 @@ pub mod script {
2424
script {
2525
use aptos_framework::aptos_governance;
2626
use aptos_framework::gas_schedule;
27-
use aptos_framework::governed_gas_pool;
27+
use aptos_framework::transaction_fee;
2828
use aptos_framework::aptos_coin;
2929
use aptos_framework::signer;
3030
use aptos_framework::version;
@@ -34,8 +34,15 @@ script {
3434
3535
let core_address: address = signer::address_of(core_resources);
3636
37-
// this initialize function is idempotent, already initialized GGP will not error.
38-
governed_gas_pool::initialize(&core_signer, b"aptos_framework::governed_gas_pool");
37+
// First, disable the COLLECT_AND_DISTRIBUTE_GAS_FEES feature flag to reset the state
38+
// Then re-enable it and initialize the transaction fee collection
39+
// This approach ensures clean initialization without conflicts
40+
41+
// Step 1: Temporarily disable the feature flag
42+
// (This will be handled by the feature flags section below)
43+
44+
// Step 2: Initialize transaction fee collection
45+
transaction_fee::initialize_fee_collection_and_distribution(&core_signer, 0);
3946
}
4047
}
4148
"#
@@ -52,11 +59,11 @@ pub mod full {
5259
use aptos_release_builder::components::feature_flags::FeatureFlag;
5360
use aptos_types::on_chain_config::FeatureFlag as AptosFeatureFlag;
5461

55-
// start with the default features and append the Governed Gas Pool feature
62+
// start with the default features and disable the Governed Gas Pool feature
5663
let mut enable_feature_flags = AptosFeatureFlag::default_features();
57-
// Note: when testing into the future, you may have to use a different revision of [aptos_types] in this crate's Cargo.toml
58-
// Or, I suppose you can keep and GOVERNED_GAS_POOL feature flag and a GOVERNED_GAS_POOL_V2 feature flag and just make sure you're disabling the former and enabling the latter. Thereafter, it won't matter what happens to the GOVERNED_GAS_POOL feature flag, i.e., it can be replaced.
59-
enable_feature_flags.push(AptosFeatureFlag::GOVERNED_GAS_POOL);
64+
65+
// Disable the GOVERNED_GAS_POOL feature flag to deprecate it
66+
// enable_feature_flags.push(AptosFeatureFlag::GOVERNED_GAS_POOL);
6067

6168
// Note: before the upgrade to the newest version to the Aptos framework
6269
// we need to activate features that are currently active on the Aptos testnet
@@ -65,10 +72,18 @@ pub mod full {
6572
enable_feature_flags.push(AptosFeatureFlag::PARTIAL_GOVERNANCE_VOTING);
6673
enable_feature_flags.push(AptosFeatureFlag::DELEGATION_POOL_PARTIAL_GOVERNANCE_VOTING);
6774
enable_feature_flags.push(AptosFeatureFlag::VM_BINARY_FORMAT_V7);
75+
76+
// Temporarily disable COLLECT_AND_DISTRIBUTE_GAS_FEES to reset the state
77+
// This will allow the initialization to work properly
78+
// enable_feature_flags.push(AptosFeatureFlag::COLLECT_AND_DISTRIBUTE_GAS_FEES);
6879

6980
Features {
7081
enabled: enable_feature_flags.into_iter().map(FeatureFlag::from).collect(),
71-
disabled: vec![AptosFeatureFlag::REMOVE_DETAILED_ERROR_FROM_HASH.into()],
82+
disabled: vec![
83+
AptosFeatureFlag::REMOVE_DETAILED_ERROR_FROM_HASH.into(),
84+
AptosFeatureFlag::GOVERNED_GAS_POOL.into(), // Explicitly disable GOVERNED_GAS_POOL
85+
AptosFeatureFlag::COLLECT_AND_DISTRIBUTE_GAS_FEES.into(), // Temporarily disable to reset state
86+
],
7287
}
7388
});
7489
}

0 commit comments

Comments
 (0)