Skip to content

Commit 5309358

Browse files
authored
Merge pull request #4891 from stacks-network/fix/signer-slots-count
Fix: signer slots count in staging
2 parents 0d850da + e4770f6 commit 5309358

File tree

3 files changed

+19
-2
lines changed

3 files changed

+19
-2
lines changed

libsigner/src/v1/messages.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1449,6 +1449,8 @@ mod test {
14491449
use super::{StacksMessageCodecExtensions, *};
14501450

14511451
#[test]
1452+
#[should_panic]
1453+
// V1 signer slots do not have enough slots in Epoch 2.5. Something will need to be updated!
14521454
fn signer_slots_count_is_sane() {
14531455
let slot_identifiers_len = MessageSlotID::ALL.len();
14541456
assert!(

stacks-common/src/libcommon.rs

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,5 +63,20 @@ 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;
67+
}
68+
69+
/// This test asserts that the constant above doesn't change.
70+
/// This exists because the constant above is used by Epoch 2.5 instantiation code.
71+
///
72+
/// Adding more slots will require instantiating more .signers contracts through either
73+
/// consensus changes (i.e., a new epoch) or through non-consensus-critical contract
74+
/// deployments.
75+
#[test]
76+
fn signer_slots_count_2_5() {
77+
assert_eq!(
78+
consts::SIGNER_SLOTS_PER_USER,
79+
13,
80+
"The .signers-x-y contracts in Epoch 2.5 were instantiated with 13 slots"
81+
);
6782
}

stacks-signer/src/client/stacks_client.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1090,7 +1090,7 @@ mod tests {
10901090
let principal_data = StacksAddress::from_string(signer).unwrap().into();
10911091

10921092
let data_map = [
1093-
("num-slots".into(), ClarityValue::UInt(14)),
1093+
("num-slots".into(), ClarityValue::UInt(13)),
10941094
(
10951095
"signer".into(),
10961096
ClarityValue::Principal(PrincipalData::Standard(principal_data)),

0 commit comments

Comments
 (0)