Skip to content

Commit 644c1c1

Browse files
authored
Merge pull request #6279 from rdeioris/feat/sip_031_epoch32_activate
Feat/sip 031 epoch32 activate
2 parents 381ee9b + 03addb8 commit 644c1c1

File tree

25 files changed

+452
-98
lines changed

25 files changed

+452
-98
lines changed

clarity/src/vm/analysis/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,8 @@ pub fn run_analysis(
152152
| StacksEpochId::Epoch24
153153
| StacksEpochId::Epoch25
154154
| StacksEpochId::Epoch30
155-
| StacksEpochId::Epoch31 => {
155+
| StacksEpochId::Epoch31
156+
| StacksEpochId::Epoch32 => {
156157
TypeChecker2_1::run_pass(&epoch, &mut contract_analysis, db, build_type_map)
157158
}
158159
StacksEpochId::Epoch10 => {

clarity/src/vm/analysis/type_checker/mod.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ impl FunctionType {
4545
| StacksEpochId::Epoch24
4646
| StacksEpochId::Epoch25
4747
| StacksEpochId::Epoch30
48-
| StacksEpochId::Epoch31 => self.check_args_2_1(accounting, args, clarity_version),
48+
| StacksEpochId::Epoch31
49+
| StacksEpochId::Epoch32 => self.check_args_2_1(accounting, args, clarity_version),
4950
StacksEpochId::Epoch10 => {
5051
Err(CheckErrors::Expects("Epoch10 is not supported".into()).into())
5152
}
@@ -69,7 +70,8 @@ impl FunctionType {
6970
| StacksEpochId::Epoch24
7071
| StacksEpochId::Epoch25
7172
| StacksEpochId::Epoch30
72-
| StacksEpochId::Epoch31 => {
73+
| StacksEpochId::Epoch31
74+
| StacksEpochId::Epoch32 => {
7375
self.check_args_by_allowing_trait_cast_2_1(db, clarity_version, func_args)
7476
}
7577
StacksEpochId::Epoch10 => {

clarity/src/vm/costs/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -857,7 +857,8 @@ impl LimitedCostTracker {
857857
| StacksEpochId::Epoch24
858858
| StacksEpochId::Epoch25
859859
| StacksEpochId::Epoch30
860-
| StacksEpochId::Epoch31 => COSTS_3_NAME.to_string(),
860+
| StacksEpochId::Epoch31
861+
| StacksEpochId::Epoch32 => COSTS_3_NAME.to_string(),
861862
};
862863
Ok(result)
863864
}

clarity/src/vm/functions/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ macro_rules! switch_on_global_epoch {
5656
StacksEpochId::Epoch30 => $Epoch205Version(args, env, context),
5757
// Note: We reuse 2.05 for 3.1.
5858
StacksEpochId::Epoch31 => $Epoch205Version(args, env, context),
59+
// Note: We reuse 2.05 for 3.2.
60+
StacksEpochId::Epoch32 => $Epoch205Version(args, env, context),
5961
}
6062
}
6163
};

clarity/src/vm/test_util/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ pub fn generate_test_burn_state_db(epoch_id: StacksEpochId) -> UnitTestBurnState
5353
| StacksEpochId::Epoch24
5454
| StacksEpochId::Epoch25
5555
| StacksEpochId::Epoch30
56-
| StacksEpochId::Epoch31 => UnitTestBurnStateDB {
56+
| StacksEpochId::Epoch31
57+
| StacksEpochId::Epoch32 => UnitTestBurnStateDB {
5758
epoch_id,
5859
ast_rules: ASTRules::PrecheckSize,
5960
},

clarity/src/vm/tests/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ epochs_template! {
125125
Epoch25,
126126
Epoch30,
127127
Epoch31,
128+
Epoch32,
128129
}
129130

130131
clarity_template! {
@@ -146,6 +147,9 @@ clarity_template! {
146147
(Epoch31, Clarity1),
147148
(Epoch31, Clarity2),
148149
(Epoch31, Clarity3),
150+
(Epoch32, Clarity1),
151+
(Epoch32, Clarity2),
152+
(Epoch32, Clarity3),
149153
}
150154

151155
#[cfg(test)]

clarity/src/vm/types/signatures.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,8 @@ impl TypeSignature {
585585
| StacksEpochId::Epoch24
586586
| StacksEpochId::Epoch25
587587
| StacksEpochId::Epoch30
588-
| StacksEpochId::Epoch31 => self.admits_type_v2_1(other),
588+
| StacksEpochId::Epoch31
589+
| StacksEpochId::Epoch32 => self.admits_type_v2_1(other),
589590
StacksEpochId::Epoch10 => Err(CheckErrors::Expects("epoch 1.0 not supported".into())),
590591
}
591592
}
@@ -793,7 +794,8 @@ impl TypeSignature {
793794
| StacksEpochId::Epoch24
794795
| StacksEpochId::Epoch25
795796
| StacksEpochId::Epoch30
796-
| StacksEpochId::Epoch31 => self.canonicalize_v2_1(),
797+
| StacksEpochId::Epoch31
798+
| StacksEpochId::Epoch32 => self.canonicalize_v2_1(),
797799
}
798800
}
799801

@@ -1152,7 +1154,8 @@ impl TypeSignature {
11521154
| StacksEpochId::Epoch24
11531155
| StacksEpochId::Epoch25
11541156
| StacksEpochId::Epoch30
1155-
| StacksEpochId::Epoch31 => Self::least_supertype_v2_1(a, b),
1157+
| StacksEpochId::Epoch31
1158+
| StacksEpochId::Epoch32 => Self::least_supertype_v2_1(a, b),
11561159
StacksEpochId::Epoch10 => Err(CheckErrors::Expects("epoch 1.0 not supported".into())),
11571160
}
11581161
}

clarity/src/vm/version.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ impl ClarityVersion {
4141
StacksEpochId::Epoch25 => ClarityVersion::Clarity2,
4242
StacksEpochId::Epoch30 => ClarityVersion::Clarity3,
4343
StacksEpochId::Epoch31 => ClarityVersion::Clarity3,
44+
StacksEpochId::Epoch32 => ClarityVersion::Clarity3,
4445
}
4546
}
4647
}

sample/conf/testnet-signer.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,3 +80,7 @@ start_height = 1900
8080
[[burnchain.epochs]]
8181
epoch_name = "3.1"
8282
start_height = 2000
83+
84+
[[burnchain.epochs]]
85+
epoch_name = "3.2"
86+
start_height = 2100

stacks-common/src/libcommon.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,11 @@ pub mod consts {
8080
pub const PEER_VERSION_EPOCH_2_5: u8 = 0x0a;
8181
pub const PEER_VERSION_EPOCH_3_0: u8 = 0x0b;
8282
pub const PEER_VERSION_EPOCH_3_1: u8 = 0x0c;
83+
pub const PEER_VERSION_EPOCH_3_2: u8 = 0x0d;
8384

8485
/// this should be updated to the latest network epoch version supported by
8586
/// this node. this will be checked by the `validate_epochs()` method.
86-
pub const PEER_NETWORK_EPOCH: u32 = PEER_VERSION_EPOCH_3_1 as u32;
87+
pub const PEER_NETWORK_EPOCH: u32 = PEER_VERSION_EPOCH_3_2 as u32;
8788

8889
/// set the fourth byte of the peer version
8990
pub const PEER_VERSION_MAINNET: u32 = PEER_VERSION_MAINNET_MAJOR | PEER_NETWORK_EPOCH;

0 commit comments

Comments
 (0)