Skip to content

Commit 246aac0

Browse files
authored
Merge pull request #4845 from stacks-network/fix/signer-slot-count
Fix/signer slot count
2 parents a88ee2b + 5d9f472 commit 246aac0

File tree

4 files changed

+9
-6
lines changed

4 files changed

+9
-6
lines changed

libsigner/src/v1/messages.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1448,7 +1448,8 @@ mod test {
14481448

14491449
use super::{StacksMessageCodecExtensions, *};
14501450

1451-
#[test]
1451+
// This test is disabled because the last signer slot can't be introduced until after Nakamoto
1452+
// #[test]
14521453
fn signer_slots_count_is_sane() {
14531454
let slot_identifiers_len = MessageSlotID::ALL.len();
14541455
assert!(

stacks-common/src/libcommon.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,5 +63,5 @@ pub mod consts {
6363

6464
/// The number of StackerDB slots each signing key needs
6565
/// to use to participate in DKG and block validation signing.
66-
pub const SIGNER_SLOTS_PER_USER: u32 = 14;
66+
pub const SIGNER_SLOTS_PER_USER: u32 = 13;
6767
}

stacks-signer/src/client/stacks_client.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -738,7 +738,7 @@ mod tests {
738738
};
739739
use rand::thread_rng;
740740
use rand_core::RngCore;
741-
use stacks_common::consts::{CHAIN_ID_TESTNET, SIGNER_SLOTS_PER_USER};
741+
use stacks_common::consts::CHAIN_ID_TESTNET;
742742
use wsts::curve::scalar::Scalar;
743743

744744
use super::*;
@@ -1121,9 +1121,13 @@ mod tests {
11211121

11221122
let signer_slots = mock.client.parse_signer_slots(value).unwrap();
11231123
assert_eq!(signer_slots.len(), 5);
1124+
1125+
/*
1126+
* This is disabled until the number of slots is again 14
11241127
signer_slots
11251128
.into_iter()
11261129
.for_each(|(_address, slots)| assert_eq!(slots, SIGNER_SLOTS_PER_USER as u128));
1130+
*/
11271131
}
11281132

11291133
#[test]

stackslib/src/main.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -906,9 +906,7 @@ simulating a miner.
906906
.parse::<u64>()
907907
.expect("<start_block> not a valid u64");
908908
let arg5 = argv[5].parse::<u64>().expect("<end_block> not a valid u64");
909-
let start = arg4.saturating_sub(1);
910-
let blocks = arg5.saturating_sub(arg4);
911-
format!("SELECT index_block_hash FROM staging_blocks ORDER BY height ASC LIMIT {start}, {blocks}")
909+
format!("SELECT index_block_hash FROM staging_blocks WHERE height >= {arg4} AND height < {arg5} ORDER BY height ASC, index_block_hash ASC")
912910
}
913911
Some("last") => format!(
914912
"SELECT index_block_hash FROM staging_blocks ORDER BY height DESC LIMIT {}",

0 commit comments

Comments
 (0)