Skip to content

Commit 65279bd

Browse files
committed
test: various fixes to get pox-5 integration tests working again
1 parent cc7d873 commit 65279bd

2 files changed

Lines changed: 21 additions & 8 deletions

File tree

stacks-node/src/tests/nakamoto_integrations.rs

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19580,6 +19580,11 @@ fn check_pox_5_stake_lifecycle() {
1958019580
&mut btc_regtest_controller,
1958119581
);
1958219582
info!("Bootstrapped to Epoch-3.0 boundary, starting nakamoto miner");
19583+
// boot_to_epoch_3 replaces signer_keys with the pox-4 signer; the pox-5
19584+
// staker below registers `signer_sk` and that key ends up in the reward
19585+
// set once pox-5 takes over signing. Add it now so blind_signer's clone
19586+
// can produce valid signatures across the pox-4 → pox-5 cycle boundary.
19587+
signers.signer_keys.push(signer_sk.clone());
1958319588
blind_signer(&naka_conf, &signers, &counters);
1958419589
wait_for_first_naka_block_commit(60, &counters.naka_submitted_commits);
1958519590

@@ -19780,6 +19785,7 @@ fn check_pox_5_stake_lifecycle() {
1978019785
"pox-5",
1978119786
"stake-update",
1978219787
&[
19788+
Value::Principal(test_signer_principal.clone()),
1978319789
Value::Principal(test_signer_principal.clone()),
1978419790
Value::UInt(1),
1978519791
Value::UInt(extra),
@@ -19825,7 +19831,7 @@ fn check_pox_5_stake_lifecycle() {
1982519831
&pox_5_addr,
1982619832
"pox-5",
1982719833
"unstake",
19828-
&[],
19834+
&[Value::Principal(test_signer_principal.clone())],
1982919835
);
1983019836
let unstake_txid = submit_tx(&http_origin, &unstake_tx);
1983119837
info!("Submitted pox-5 unstake txid: {unstake_txid} (attempt {attempt})");
@@ -20017,6 +20023,11 @@ fn check_pox_5_register_for_bond_lifecycle() {
2001720023
&mut btc_regtest_controller,
2001820024
);
2001920025
info!("Bootstrapped to Epoch-3.0 boundary, starting nakamoto miner");
20026+
// boot_to_epoch_3 replaces signer_keys with the pox-4 signer; the pox-5
20027+
// staker below registers `signer_sk` and that key ends up in the reward
20028+
// set once pox-5 takes over signing. Add it now so blind_signer's clone
20029+
// can produce valid signatures across the pox-4 → pox-5 cycle boundary.
20030+
signers.signer_keys.push(signer_sk.clone());
2002020031
blind_signer(&naka_conf, &signers, &counters);
2002120032
wait_for_first_naka_block_commit(60, &counters.naka_submitted_commits);
2002220033

@@ -20205,6 +20216,7 @@ fn check_pox_5_register_for_bond_lifecycle() {
2020520216
Value::UInt(100),
2020620217
Value::UInt(10000),
2020720218
Value::buff_from(vec![0u8; 683]).unwrap(),
20219+
Value::Principal(bond_admin_addr.clone().into()),
2020820220
allowlist_value,
2020920221
],
2021020222
);
@@ -20360,7 +20372,7 @@ fn check_pox_5_register_for_bond_lifecycle() {
2036020372
&pox_5_addr,
2036120373
"pox-5",
2036220374
"unstake",
20363-
&[],
20375+
&[Value::Principal(test_signer_principal.clone())],
2036420376
);
2036520377
let unstake_txid = submit_tx(&http_origin, &unstake_tx);
2036620378
info!("Submitted pox-5 unstake (bond holder) txid: {unstake_txid}");
@@ -21439,6 +21451,7 @@ fn check_with_stacking_allowances_register_for_bond() {
2143921451
Value::UInt(100),
2144021452
Value::UInt(10000),
2144121453
Value::buff_from(vec![0u8; 683]).unwrap(),
21454+
Value::Principal(bond_admin_addr.clone().into()),
2144221455
allowlist_value,
2144321456
],
2144421457
);

stackslib/src/chainstate/nakamoto/signer_set.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -326,21 +326,21 @@ impl<'a, 'b, 'c> StakeEntryIteratorPox5<'a, 'b, 'c> {
326326
.clarity
327327
.eval_method_read_only(
328328
&self.pox_contract,
329-
"get-staker-set-next-item-for-cycle",
329+
"get-signer-set-next-item-for-cycle",
330330
&[lookup_signer.clone(), self.reward_cycle_clar.clone()],
331331
)
332332
.map_err(|e| PoxEntryParsingError::Abort(e.to_string()))?
333333
.expect_optional()
334334
.map_err(|_| {
335335
PoxEntryParsingError::Abort(
336-
"get-staker-set-next-item-for-cycle did not return optional".into(),
336+
"get-signer-set-next-item-for-cycle did not return optional".into(),
337337
)
338338
})?
339339
.map(|entry| entry.expect_principal())
340340
.transpose()
341341
.map_err(|_| {
342342
PoxEntryParsingError::Abort(
343-
"get-staker-set-next-item-for-cycle did not return principal".into(),
343+
"get-signer-set-next-item-for-cycle did not return principal".into(),
344344
)
345345
})?;
346346
self.current_signer = next_signer;
@@ -436,20 +436,20 @@ impl NakamotoSigners {
436436
let current_signer = clarity
437437
.eval_method_read_only(
438438
&pox_contract,
439-
"get-staker-set-first-item-for-cycle",
439+
"get-signer-set-first-item-for-cycle",
440440
&[reward_cycle_clar.clone()],
441441
)?
442442
.expect_optional()
443443
.map_err(|_| {
444444
ChainstateError::Expects(
445-
"get-staker-set-first-item-for-cycle did not return optional".into(),
445+
"get-signer-set-first-item-for-cycle did not return optional".into(),
446446
)
447447
})?
448448
.map(|value| value.expect_principal())
449449
.transpose()
450450
.map_err(|_| {
451451
ChainstateError::Expects(
452-
"get-staker-set-first-item-for-cycle did not return optional principal".into(),
452+
"get-signer-set-first-item-for-cycle did not return optional principal".into(),
453453
)
454454
})?;
455455

0 commit comments

Comments
 (0)