Skip to content

Commit ea5e1ed

Browse files
Merge branch 'develop' of https://github.com/stacks-network/stacks-core into chore/fix-race-conditions-in-scenario-tests
2 parents f3e0eec + f8d02cd commit ea5e1ed

File tree

17 files changed

+198
-144
lines changed

17 files changed

+198
-144
lines changed

docs/rpc/components/schemas/block-replay.schema.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,4 +75,7 @@ properties:
7575
description: index of the transaction in the array of transactions
7676
txid:
7777
type: string
78-
description: transaction id
78+
description: transaction id
79+
vm_error:
80+
type: [string, "null"]
81+
description: optional vm error (for runtime failures)

sample/conf/testnet-follower-conf.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,3 +86,7 @@ start_height = 2000
8686
[[burnchain.epochs]]
8787
epoch_name = "3.2"
8888
start_height = 71525
89+
90+
[[burnchain.epochs]]
91+
epoch_name = "3.3"
92+
start_height = 108800

sample/conf/testnet-miner-conf.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,3 +82,7 @@ start_height = 2000
8282
[[burnchain.epochs]]
8383
epoch_name = "3.2"
8484
start_height = 71525
85+
86+
[[burnchain.epochs]]
87+
epoch_name = "3.3"
88+
start_height = 108800

sample/conf/testnet-signer.toml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,4 +83,8 @@ start_height = 2000
8383

8484
[[burnchain.epochs]]
8585
epoch_name = "3.2"
86-
start_height = 2100
86+
start_height = 71525
87+
88+
[[burnchain.epochs]]
89+
epoch_name = "3.3"
90+
start_height = 108800
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
(begin
2-
(as-contract
2+
(try! (as-contract? ()
33
(contract-call? 'S1G2081040G2081040G2081040G208105NK8PE5.tokens-ft mint! u100)
4-
)
4+
))
55
)

sample/contracts/tokens-mint.clar

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
(begin
2-
(as-contract
2+
(try! (as-contract? ()
33
(contract-call? 'S1G2081040G2081040G2081040G208105NK8PE5.tokens mint! u100)
4-
)
4+
))
55
)

stacks-common/src/types/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ impl StacksEpochId {
438438

439439
#[cfg(not(any(test, feature = "testing")))]
440440
pub const fn latest() -> StacksEpochId {
441-
StacksEpochId::Epoch32
441+
StacksEpochId::Epoch33
442442
}
443443

444444
pub const ALL_GTE_30: &'static [StacksEpochId] = &[

stacks-node/src/tests/nakamoto_integrations.rs

Lines changed: 3 additions & 106 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ use stacks::clarity_vm::clarity::SIP_031_INITIAL_MINT;
146146
use crate::clarity::vm::clarity::ClarityConnection;
147147

148148
lazy_static! {
149-
pub static ref NAKAMOTO_INTEGRATION_EPOCHS: [StacksEpoch; 11] = [
149+
pub static ref NAKAMOTO_INTEGRATION_EPOCHS: [StacksEpoch; 12] = [
150150
StacksEpoch {
151151
epoch_id: StacksEpochId::Epoch10,
152152
start_height: 0,
@@ -220,92 +220,13 @@ lazy_static! {
220220
StacksEpoch {
221221
epoch_id: StacksEpochId::Epoch32,
222222
start_height: 251,
223-
end_height: STACKS_EPOCH_MAX,
224-
block_limit: HELIUM_BLOCK_LIMIT_20,
225-
network_epoch: PEER_VERSION_EPOCH_3_2
226-
},
227-
];
228-
pub static ref NAKAMOTO_INTEGRATION_3_3_EPOCHS: [StacksEpoch; 12] = [
229-
StacksEpoch {
230-
epoch_id: StacksEpochId::Epoch10,
231-
start_height: 0,
232-
end_height: 0,
233-
block_limit: BLOCK_LIMIT_MAINNET_10,
234-
network_epoch: PEER_VERSION_EPOCH_1_0
235-
},
236-
StacksEpoch {
237-
epoch_id: StacksEpochId::Epoch20,
238-
start_height: 0,
239-
end_height: 1,
240-
block_limit: HELIUM_BLOCK_LIMIT_20,
241-
network_epoch: PEER_VERSION_EPOCH_2_0
242-
},
243-
StacksEpoch {
244-
epoch_id: StacksEpochId::Epoch2_05,
245-
start_height: 1,
246-
end_height: 2,
247-
block_limit: HELIUM_BLOCK_LIMIT_20,
248-
network_epoch: PEER_VERSION_EPOCH_2_05
249-
},
250-
StacksEpoch {
251-
epoch_id: StacksEpochId::Epoch21,
252-
start_height: 2,
253-
end_height: 3,
254-
block_limit: HELIUM_BLOCK_LIMIT_20,
255-
network_epoch: PEER_VERSION_EPOCH_2_1
256-
},
257-
StacksEpoch {
258-
epoch_id: StacksEpochId::Epoch22,
259-
start_height: 3,
260-
end_height: 4,
261-
block_limit: HELIUM_BLOCK_LIMIT_20,
262-
network_epoch: PEER_VERSION_EPOCH_2_2
263-
},
264-
StacksEpoch {
265-
epoch_id: StacksEpochId::Epoch23,
266-
start_height: 4,
267-
end_height: 5,
268-
block_limit: HELIUM_BLOCK_LIMIT_20,
269-
network_epoch: PEER_VERSION_EPOCH_2_3
270-
},
271-
StacksEpoch {
272-
epoch_id: StacksEpochId::Epoch24,
273-
start_height: 5,
274-
end_height: 201,
275-
block_limit: HELIUM_BLOCK_LIMIT_20,
276-
network_epoch: PEER_VERSION_EPOCH_2_4
277-
},
278-
StacksEpoch {
279-
epoch_id: StacksEpochId::Epoch25,
280-
start_height: 201,
281-
end_height: 231,
282-
block_limit: HELIUM_BLOCK_LIMIT_20,
283-
network_epoch: PEER_VERSION_EPOCH_2_5
284-
},
285-
StacksEpoch {
286-
epoch_id: StacksEpochId::Epoch30,
287-
start_height: 231,
288-
end_height: 232,
289-
block_limit: HELIUM_BLOCK_LIMIT_20,
290-
network_epoch: PEER_VERSION_EPOCH_3_0
291-
},
292-
StacksEpoch {
293-
epoch_id: StacksEpochId::Epoch31,
294-
start_height: 232,
295-
end_height: 233,
296-
block_limit: HELIUM_BLOCK_LIMIT_20,
297-
network_epoch: PEER_VERSION_EPOCH_3_1
298-
},
299-
StacksEpoch {
300-
epoch_id: StacksEpochId::Epoch32,
301-
start_height: 233,
302-
end_height: 234,
223+
end_height: 252,
303224
block_limit: HELIUM_BLOCK_LIMIT_20,
304225
network_epoch: PEER_VERSION_EPOCH_3_2
305226
},
306227
StacksEpoch {
307228
epoch_id: StacksEpochId::Epoch33,
308-
start_height: 234,
229+
start_height: 252,
309230
end_height: STACKS_EPOCH_MAX,
310231
block_limit: HELIUM_BLOCK_LIMIT_20,
311232
network_epoch: PEER_VERSION_EPOCH_3_2
@@ -14251,10 +14172,6 @@ fn test_epoch_3_3_activation() {
1425114172
naka_conf.node.pox_sync_sample_secs = 180;
1425214173
naka_conf.burnchain.max_rbf = 10_000_000;
1425314174

14254-
// Add epoch 3.3 to the configuration because it is not yet added to the
14255-
// default epoch list for integration tests.
14256-
naka_conf.burnchain.epochs = Some(EpochList::new(&*NAKAMOTO_INTEGRATION_3_3_EPOCHS));
14257-
1425814175
let sender_signer_sk = Secp256k1PrivateKey::random();
1425914176
let sender_signer_addr = tests::to_addr(&sender_signer_sk);
1426014177
let mut signers = TestSigners::new(vec![sender_signer_sk.clone()]);
@@ -15094,10 +15011,6 @@ fn check_block_time_keyword() {
1509415011
100000,
1509515012
);
1509615013

15097-
// Add epoch 3.3 to the configuration because it is not yet added to the
15098-
// default epoch list for integration tests.
15099-
naka_conf.burnchain.epochs = Some(EpochList::new(&*NAKAMOTO_INTEGRATION_3_3_EPOCHS));
15100-
1510115014
let stacker_sk = setup_stacker(&mut naka_conf);
1510215015

1510315016
test_observer::spawn();
@@ -15377,10 +15290,6 @@ fn check_with_stacking_allowances_delegate_stx() {
1537715290
100000,
1537815291
);
1537915292

15380-
// Add epoch 3.3 to the configuration because it is not yet added to the
15381-
// default epoch list for integration tests.
15382-
naka_conf.burnchain.epochs = Some(EpochList::new(&*NAKAMOTO_INTEGRATION_3_3_EPOCHS));
15383-
1538415293
let stacker_sk = setup_stacker(&mut naka_conf);
1538515294

1538615295
test_observer::spawn();
@@ -15777,10 +15686,6 @@ fn check_with_stacking_allowances_stack_stx() {
1577715686
100000,
1577815687
);
1577915688

15780-
// Add epoch 3.3 to the configuration because it is not yet added to the
15781-
// default epoch list for integration tests.
15782-
naka_conf.burnchain.epochs = Some(EpochList::new(&*NAKAMOTO_INTEGRATION_3_3_EPOCHS));
15783-
1578415689
// Default stacker used for bootstrapping
1578515690
let stacker_sk = setup_stacker(&mut naka_conf);
1578615691

@@ -16371,10 +16276,6 @@ fn check_restrict_assets_rollback() {
1637116276
100000,
1637216277
);
1637316278

16374-
// Add epoch 3.3 to the configuration because it is not yet added to the
16375-
// default epoch list for integration tests.
16376-
naka_conf.burnchain.epochs = Some(EpochList::new(&*NAKAMOTO_INTEGRATION_3_3_EPOCHS));
16377-
1637816279
let stacker_sk = setup_stacker(&mut naka_conf);
1637916280

1638016281
test_observer::spawn();
@@ -17092,10 +16993,6 @@ fn check_as_contract_rollback() {
1709216993
100000,
1709316994
);
1709416995

17095-
// Add epoch 3.3 to the configuration because it is not yet added to the
17096-
// default epoch list for integration tests.
17097-
naka_conf.burnchain.epochs = Some(EpochList::new(&*NAKAMOTO_INTEGRATION_3_3_EPOCHS));
17098-
1709916996
let stacker_sk = setup_stacker(&mut naka_conf);
1710016997

1710116998
test_observer::spawn();

stacks-node/src/tests/signer/v0.rs

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ use stacks::util_lib::signed_structured_data::pox4::{
8585
};
8686
use stacks_common::bitvec::BitVec;
8787
use stacks_common::types::chainstate::TrieHash;
88-
use stacks_common::types::EpochList;
8988
use stacks_common::util::sleep_ms;
9089
use stacks_signer::chainstate::v1::SortitionsView;
9190
use stacks_signer::chainstate::ProposalEvalConfig;
@@ -127,7 +126,7 @@ use crate::run_loop::boot_nakamoto;
127126
use crate::tests::nakamoto_integrations::{
128127
boot_to_epoch_25, boot_to_epoch_3_reward_set, next_block_and, next_block_and_controller,
129128
next_block_and_process_new_stacks_block, setup_epoch_3_reward_set, wait_for,
130-
NAKAMOTO_INTEGRATION_3_3_EPOCHS, POX_4_DEFAULT_STACKER_BALANCE, POX_4_DEFAULT_STACKER_STX_AMT,
129+
POX_4_DEFAULT_STACKER_BALANCE, POX_4_DEFAULT_STACKER_STX_AMT,
131130
};
132131
use crate::tests::neon_integrations::{
133132
get_account, get_chain_info, get_chain_info_opt, get_sortition_info, get_sortition_info_ch,
@@ -1931,17 +1930,15 @@ fn sip034_tenure_extend_proposal(allow: bool) {
19311930
},
19321931
|node_config| {
19331932
// boot directly to epoch 3.3
1934-
let mut epoch_33 = EpochList::new(&*NAKAMOTO_INTEGRATION_3_3_EPOCHS);
1935-
let epoch_30_height = epoch_33[StacksEpochId::Epoch30].start_height;
1936-
1937-
epoch_33[StacksEpochId::Epoch30].end_height = epoch_30_height;
1938-
epoch_33[StacksEpochId::Epoch31].start_height = epoch_30_height;
1939-
epoch_33[StacksEpochId::Epoch31].end_height = epoch_30_height;
1940-
epoch_33[StacksEpochId::Epoch32].start_height = epoch_30_height;
1941-
epoch_33[StacksEpochId::Epoch32].end_height = epoch_30_height;
1942-
epoch_33[StacksEpochId::Epoch33].start_height = epoch_30_height;
1943-
1944-
node_config.burnchain.epochs = Some(epoch_33);
1933+
let epochs = node_config.burnchain.epochs.as_mut().unwrap();
1934+
let epoch_30_height = epochs[StacksEpochId::Epoch30].start_height;
1935+
1936+
epochs[StacksEpochId::Epoch30].end_height = epoch_30_height;
1937+
epochs[StacksEpochId::Epoch31].start_height = epoch_30_height;
1938+
epochs[StacksEpochId::Epoch31].end_height = epoch_30_height;
1939+
epochs[StacksEpochId::Epoch32].start_height = epoch_30_height;
1940+
epochs[StacksEpochId::Epoch32].end_height = epoch_30_height;
1941+
epochs[StacksEpochId::Epoch33].start_height = epoch_30_height;
19451942
},
19461943
None,
19471944
None,
@@ -3299,6 +3296,8 @@ fn bitcoind_forking_test() {
32993296
epochs[StacksEpochId::Epoch31].start_height = 3_015;
33003297
epochs[StacksEpochId::Epoch31].end_height = 3_055;
33013298
epochs[StacksEpochId::Epoch32].start_height = 3_055;
3299+
epochs[StacksEpochId::Epoch32].end_height = 3_065;
3300+
epochs[StacksEpochId::Epoch33].start_height = 3_065;
33023301
},
33033302
None,
33043303
None,
@@ -7874,6 +7873,8 @@ fn mock_sign_epoch_25() {
78747873
epochs[StacksEpochId::Epoch31].start_height = 265;
78757874
epochs[StacksEpochId::Epoch31].end_height = 285;
78767875
epochs[StacksEpochId::Epoch32].start_height = 285;
7876+
epochs[StacksEpochId::Epoch32].end_height = 305;
7877+
epochs[StacksEpochId::Epoch33].start_height = 305;
78777878
},
78787879
None,
78797880
None,
@@ -7994,6 +7995,8 @@ fn multiple_miners_mock_sign_epoch_25() {
79947995
epochs[StacksEpochId::Epoch31].start_height = 265;
79957996
epochs[StacksEpochId::Epoch31].end_height = 285;
79967997
epochs[StacksEpochId::Epoch32].start_height = 285;
7998+
epochs[StacksEpochId::Epoch32].end_height = 305;
7999+
epochs[StacksEpochId::Epoch33].start_height = 305;
79978000
},
79988001
|_| {},
79998002
);

stackslib/src/clarity_cli.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ use stacks_common::util::hash::{bytes_to_hex, Hash160, Sha512Trunc256Sum};
3737
use crate::burnchains::{PoxConstants, Txid};
3838
use crate::chainstate::stacks::boot::{
3939
BOOT_CODE_BNS, BOOT_CODE_COSTS, BOOT_CODE_COSTS_2, BOOT_CODE_COSTS_2_TESTNET,
40-
BOOT_CODE_COSTS_3, BOOT_CODE_COST_VOTING_MAINNET, BOOT_CODE_COST_VOTING_TESTNET,
41-
BOOT_CODE_GENESIS, BOOT_CODE_LOCKUP, BOOT_CODE_POX_MAINNET, BOOT_CODE_POX_TESTNET,
42-
POX_2_MAINNET_CODE, POX_2_TESTNET_CODE,
40+
BOOT_CODE_COSTS_3, BOOT_CODE_COSTS_4, BOOT_CODE_COST_VOTING_MAINNET,
41+
BOOT_CODE_COST_VOTING_TESTNET, BOOT_CODE_GENESIS, BOOT_CODE_LOCKUP, BOOT_CODE_POX_MAINNET,
42+
BOOT_CODE_POX_TESTNET, POX_2_MAINNET_CODE, POX_2_TESTNET_CODE,
4343
};
4444
use crate::chainstate::stacks::index::ClarityMarfTrieId;
4545
use crate::clarity::vm::analysis::contract_interface_builder::build_contract_interface;
@@ -65,7 +65,7 @@ use crate::util_lib::boot::{boot_code_addr, boot_code_id};
6565
use crate::util_lib::db::{sqlite_open, FromColumn};
6666

6767
lazy_static! {
68-
pub static ref STACKS_BOOT_CODE_MAINNET_2_1: [(&'static str, &'static str); 9] = [
68+
pub static ref STACKS_BOOT_CODE_MAINNET_2_1: [(&'static str, &'static str); 10] = [
6969
("pox", &BOOT_CODE_POX_MAINNET),
7070
("lockup", BOOT_CODE_LOCKUP),
7171
("costs", BOOT_CODE_COSTS),
@@ -75,8 +75,9 @@ lazy_static! {
7575
("costs-2", BOOT_CODE_COSTS_2),
7676
("pox-2", &POX_2_MAINNET_CODE),
7777
("costs-3", BOOT_CODE_COSTS_3),
78+
("costs-4", BOOT_CODE_COSTS_4),
7879
];
79-
pub static ref STACKS_BOOT_CODE_TESTNET_2_1: [(&'static str, &'static str); 9] = [
80+
pub static ref STACKS_BOOT_CODE_TESTNET_2_1: [(&'static str, &'static str); 10] = [
8081
("pox", &BOOT_CODE_POX_TESTNET),
8182
("lockup", BOOT_CODE_LOCKUP),
8283
("costs", BOOT_CODE_COSTS),
@@ -86,6 +87,7 @@ lazy_static! {
8687
("costs-2", BOOT_CODE_COSTS_2_TESTNET),
8788
("pox-2", &POX_2_TESTNET_CODE),
8889
("costs-3", BOOT_CODE_COSTS_3),
90+
("costs-4", BOOT_CODE_COSTS_4),
8991
];
9092
}
9193

@@ -138,7 +140,7 @@ fn friendly_expect_opt<A>(input: Option<A>, msg: &str) -> A {
138140
})
139141
}
140142

141-
pub const DEFAULT_CLI_EPOCH: StacksEpochId = StacksEpochId::Epoch32;
143+
pub const DEFAULT_CLI_EPOCH: StacksEpochId = StacksEpochId::Epoch33;
142144

143145
struct EvalInput {
144146
marf_kv: MarfedKV,

0 commit comments

Comments
 (0)