Skip to content

Commit 40f6a74

Browse files
committed
Merge branch 'develop' into chore/signer-coordinator-logging
2 parents c03f633 + 2233e5e commit 40f6a74

File tree

141 files changed

+1212
-1629
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

141 files changed

+1212
-1629
lines changed

.github/workflows/bitcoin-tests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ jobs:
124124
- tests::signer::v0::signing_in_0th_tenure_of_reward_cycle
125125
- tests::signer::v0::continue_after_tenure_extend
126126
- tests::signer::v0::tenure_extend_after_idle_signers
127+
- tests::signer::v0::tenure_extend_with_other_transactions
127128
- tests::signer::v0::tenure_extend_after_idle_miner
128129
- tests::signer::v0::tenure_extend_after_failed_miner
129130
- tests::signer::v0::tenure_extend_succeeds_after_rejected_attempt

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to the versioning scheme outlined in the [README.md](README.md).
77

8+
## [Unreleased]
9+
10+
### Changed
11+
12+
- Miner will include other transactions in blocks with tenure extend transactions (#5760)
13+
814
## [3.1.0.0.4]
915

1016
### Added

Cargo.lock

Lines changed: 41 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

clarity/src/libclarity.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,7 @@ pub mod boot_util {
6060
pub fn boot_code_id(name: &str, mainnet: bool) -> QualifiedContractIdentifier {
6161
let addr = boot_code_addr(mainnet);
6262
QualifiedContractIdentifier::new(
63-
addr.try_into()
64-
.expect("FATAL: boot contract addr is not a legal principal"),
63+
addr.into(),
6564
ContractName::try_from(name.to_string())
6665
.expect("FATAL: boot contract name is not a legal ContractName"),
6766
)

clarity/src/vm/contexts.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2140,8 +2140,8 @@ mod test {
21402140
// not simply rollback the tx and squelch the error as includable.
21412141
let e = env
21422142
.stx_transfer(
2143-
&PrincipalData::try_from(u1).unwrap(),
2144-
&PrincipalData::try_from(u2).unwrap(),
2143+
&PrincipalData::from(u1),
2144+
&PrincipalData::from(u2),
21452145
1000,
21462146
&BuffData::empty(),
21472147
)

clarity/src/vm/test_util/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ impl From<&StacksPrivateKey> for StandardPrincipalData {
108108
&vec![StacksPublicKey::from_private(o)],
109109
)
110110
.unwrap();
111-
StandardPrincipalData::try_from(stacks_addr).unwrap()
111+
StandardPrincipalData::from(stacks_addr)
112112
}
113113
}
114114

clarity/src/vm/tests/simple_apply_eval.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ fn test_secp256k1() {
430430
)
431431
.unwrap();
432432
eprintln!("addr from privk {:?}", &addr);
433-
let principal = addr.try_into().unwrap();
433+
let principal = addr.into();
434434
if let PrincipalData::Standard(data) = principal {
435435
eprintln!("test_secp256k1 principal {:?}", data.to_address());
436436
}
@@ -446,7 +446,7 @@ fn test_secp256k1() {
446446
)
447447
.unwrap();
448448
eprintln!("addr from hex {:?}", addr);
449-
let principal: PrincipalData = addr.try_into().unwrap();
449+
let principal: PrincipalData = addr.into();
450450
if let PrincipalData::Standard(data) = principal.clone() {
451451
eprintln!("test_secp256k1 principal {:?}", data.to_address());
452452
}
@@ -491,8 +491,7 @@ fn test_principal_of_fix() {
491491
.unwrap()],
492492
)
493493
.unwrap()
494-
.try_into()
495-
.unwrap();
494+
.into();
496495
let testnet_principal: PrincipalData = StacksAddress::from_public_keys(
497496
C32_ADDRESS_VERSION_TESTNET_SINGLESIG,
498497
&AddressHashMode::SerializeP2PKH,
@@ -503,8 +502,7 @@ fn test_principal_of_fix() {
503502
.unwrap()],
504503
)
505504
.unwrap()
506-
.try_into()
507-
.unwrap();
505+
.into();
508506

509507
// Clarity2, mainnet, should have a mainnet principal.
510508
assert_eq!(

clarity/src/vm/types/mod.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1531,9 +1531,8 @@ impl From<StandardPrincipalData> for StacksAddress {
15311531
fn from(o: StandardPrincipalData) -> StacksAddress {
15321532
// should be infallible because it's impossible to construct a StandardPrincipalData with
15331533
// an unsupported version byte
1534-
StacksAddress::new(o.version(), hash::Hash160(o.1)).unwrap_or_else(|_| {
1535-
panic!("FATAL: could not convert a StandardPrincipalData to StacksAddress")
1536-
})
1534+
StacksAddress::new(o.version(), hash::Hash160(o.1))
1535+
.expect("FATAL: could not convert a StandardPrincipalData to StacksAddress")
15371536
}
15381537
}
15391538

libsigner/src/tests/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ fn test_simple_signer() {
128128
reward_cycle: 1,
129129
};
130130
for i in 0..max_events {
131-
let privk = Secp256k1PrivateKey::new();
131+
let privk = Secp256k1PrivateKey::random();
132132
let message = SignerMessage::BlockProposal(block_proposal.clone());
133133
let message_bytes = message.serialize_to_vec();
134134
let mut chunk = StackerDBChunkData::new(i as u32, 1, message_bytes);

libsigner/src/v0/messages.rs

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1192,7 +1192,7 @@ mod test {
11921192
let rejection = BlockRejection::new(
11931193
Sha512Trunc256Sum([0u8; 32]),
11941194
RejectCode::ValidationFailed(ValidateRejectCode::InvalidBlock),
1195-
&StacksPrivateKey::new(),
1195+
&StacksPrivateKey::random(),
11961196
thread_rng().gen_bool(0.5),
11971197
thread_rng().next_u64(),
11981198
);
@@ -1204,7 +1204,7 @@ mod test {
12041204
let rejection = BlockRejection::new(
12051205
Sha512Trunc256Sum([1u8; 32]),
12061206
RejectCode::ConnectivityIssues,
1207-
&StacksPrivateKey::new(),
1207+
&StacksPrivateKey::random(),
12081208
thread_rng().gen_bool(0.5),
12091209
thread_rng().next_u64(),
12101210
);
@@ -1231,7 +1231,7 @@ mod test {
12311231
let response = BlockResponse::Rejected(BlockRejection::new(
12321232
Sha512Trunc256Sum([1u8; 32]),
12331233
RejectCode::ValidationFailed(ValidateRejectCode::InvalidBlock),
1234-
&StacksPrivateKey::new(),
1234+
&StacksPrivateKey::random(),
12351235
thread_rng().gen_bool(0.5),
12361236
thread_rng().next_u64(),
12371237
));
@@ -1318,10 +1318,10 @@ mod test {
13181318

13191319
#[test]
13201320
fn verify_sign_mock_proposal() {
1321-
let private_key = StacksPrivateKey::new();
1321+
let private_key = StacksPrivateKey::random();
13221322
let public_key = StacksPublicKey::from_private(&private_key);
13231323

1324-
let bad_private_key = StacksPrivateKey::new();
1324+
let bad_private_key = StacksPrivateKey::random();
13251325
let bad_public_key = StacksPublicKey::from_private(&bad_private_key);
13261326

13271327
let mut mock_proposal = random_mock_proposal();
@@ -1353,7 +1353,7 @@ mod test {
13531353
#[test]
13541354
fn serde_mock_proposal() {
13551355
let mut mock_signature = random_mock_proposal();
1356-
mock_signature.sign(&StacksPrivateKey::new()).unwrap();
1356+
mock_signature.sign(&StacksPrivateKey::random()).unwrap();
13571357
let serialized_signature = mock_signature.serialize_to_vec();
13581358
let deserialized_signature = read_next::<MockProposal, _>(&mut &serialized_signature[..])
13591359
.expect("Failed to deserialize MockSignature");
@@ -1368,7 +1368,7 @@ mod test {
13681368
metadata: SignerMessageMetadata::default(),
13691369
};
13701370
mock_signature
1371-
.sign(&StacksPrivateKey::new())
1371+
.sign(&StacksPrivateKey::random())
13721372
.expect("Failed to sign MockSignature");
13731373
let serialized_signature = mock_signature.serialize_to_vec();
13741374
let deserialized_signature = read_next::<MockSignature, _>(&mut &serialized_signature[..])
@@ -1379,8 +1379,10 @@ mod test {
13791379
#[test]
13801380
fn serde_mock_block() {
13811381
let mock_proposal = random_mock_proposal();
1382-
let mock_signature_1 = MockSignature::new(mock_proposal.clone(), &StacksPrivateKey::new());
1383-
let mock_signature_2 = MockSignature::new(mock_proposal.clone(), &StacksPrivateKey::new());
1382+
let mock_signature_1 =
1383+
MockSignature::new(mock_proposal.clone(), &StacksPrivateKey::random());
1384+
let mock_signature_2 =
1385+
MockSignature::new(mock_proposal.clone(), &StacksPrivateKey::random());
13841386
let mock_block = MockBlock {
13851387
mock_proposal,
13861388
mock_signatures: vec![mock_signature_1, mock_signature_2],

0 commit comments

Comments
 (0)