Merge pull request #4845 from stacks-network/fix/signer-slot-count

Fix/signer slot count
This commit is contained in:
wileyj
2024-06-04 08:13:00 -07:00
committed by GitHub
4 changed files with 9 additions and 6 deletions

View File

@@ -1448,7 +1448,8 @@ mod test {
use super::{StacksMessageCodecExtensions, *};
#[test]
// This test is disabled because the last signer slot can't be introduced until after Nakamoto
// #[test]
fn signer_slots_count_is_sane() {
let slot_identifiers_len = MessageSlotID::ALL.len();
assert!(

View File

@@ -63,5 +63,5 @@ pub mod consts {
/// The number of StackerDB slots each signing key needs
/// to use to participate in DKG and block validation signing.
pub const SIGNER_SLOTS_PER_USER: u32 = 14;
pub const SIGNER_SLOTS_PER_USER: u32 = 13;
}

View File

@@ -738,7 +738,7 @@ mod tests {
};
use rand::thread_rng;
use rand_core::RngCore;
use stacks_common::consts::{CHAIN_ID_TESTNET, SIGNER_SLOTS_PER_USER};
use stacks_common::consts::CHAIN_ID_TESTNET;
use wsts::curve::scalar::Scalar;
use super::*;
@@ -1121,9 +1121,13 @@ mod tests {
let signer_slots = mock.client.parse_signer_slots(value).unwrap();
assert_eq!(signer_slots.len(), 5);
/*
* This is disabled until the number of slots is again 14
signer_slots
.into_iter()
.for_each(|(_address, slots)| assert_eq!(slots, SIGNER_SLOTS_PER_USER as u128));
*/
}
#[test]

View File

@@ -906,9 +906,7 @@ simulating a miner.
.parse::<u64>()
.expect("<start_block> not a valid u64");
let arg5 = argv[5].parse::<u64>().expect("<end_block> not a valid u64");
let start = arg4.saturating_sub(1);
let blocks = arg5.saturating_sub(arg4);
format!("SELECT index_block_hash FROM staging_blocks ORDER BY height ASC LIMIT {start}, {blocks}")
format!("SELECT index_block_hash FROM staging_blocks WHERE height >= {arg4} AND height < {arg5} ORDER BY height ASC, index_block_hash ASC")
}
Some("last") => format!(
"SELECT index_block_hash FROM staging_blocks ORDER BY height DESC LIMIT {}",