Skip to content

Commit 791f555

Browse files
authored
Merge pull request #5941 from Jiloc/chore/consistent-log-label-signer-signature-hash
chore: consolidate label for signer_signature_hash
2 parents e31481d + 7777b86 commit 791f555

File tree

11 files changed

+80
-76
lines changed

11 files changed

+80
-76
lines changed

libsigner/src/v0/messages.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1040,14 +1040,14 @@ impl std::fmt::Display for BlockResponse {
10401040
BlockResponse::Accepted(a) => {
10411041
write!(
10421042
f,
1043-
"BlockAccepted: signer_sighash = {}, signature = {}, version = {}",
1043+
"BlockAccepted: signer_signature_hash = {}, signature = {}, version = {}",
10441044
a.signer_signature_hash, a.signature, a.metadata.server_version
10451045
)
10461046
}
10471047
BlockResponse::Rejected(r) => {
10481048
write!(
10491049
f,
1050-
"BlockRejected: signer_sighash = {}, code = {}, reason = {}, signature = {}, version = {}",
1050+
"BlockRejected: signer_signature_hash = {}, code = {}, reason = {}, signature = {}, version = {}",
10511051
r.reason_code, r.reason, r.signer_signature_hash, r.signature, r.metadata.server_version
10521052
)
10531053
}

stacks-signer/src/chainstate.rs

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ impl SortitionsView {
289289
warn!(
290290
"Miner block proposal has bitvec field which punishes in disagreement with signer. Considering invalid.";
291291
"proposed_block_consensus_hash" => %block.header.consensus_hash,
292-
"proposed_block_signer_sighash" => %block.header.signer_signature_hash(),
292+
"signer_signature_hash" => %block.header.signer_signature_hash(),
293293
"current_sortition_consensus_hash" => ?self.cur_sortition.consensus_hash,
294294
"last_sortition_consensus_hash" => ?self.last_sortition.as_ref().map(|x| x.consensus_hash),
295295
);
@@ -327,7 +327,7 @@ impl SortitionsView {
327327
warn!(
328328
"Miner block proposal has consensus hash that is neither the current or last sortition. Considering invalid.";
329329
"proposed_block_consensus_hash" => %block.header.consensus_hash,
330-
"proposed_block_signer_sighash" => %block.header.signer_signature_hash(),
330+
"signer_signature_hash" => %block.header.signer_signature_hash(),
331331
"current_sortition_consensus_hash" => ?self.cur_sortition.consensus_hash,
332332
"last_sortition_consensus_hash" => ?self.last_sortition.as_ref().map(|x| x.consensus_hash),
333333
);
@@ -338,7 +338,7 @@ impl SortitionsView {
338338
warn!(
339339
"Miner block proposal pubkey does not match the winning pubkey hash for its sortition. Considering invalid.";
340340
"proposed_block_consensus_hash" => %block.header.consensus_hash,
341-
"proposed_block_signer_sighash" => %block.header.signer_signature_hash(),
341+
"signer_signature_hash" => %block.header.signer_signature_hash(),
342342
"proposed_block_pubkey" => &block_pk.to_hex(),
343343
"proposed_block_pubkey_hash" => %block_pkh,
344344
"sortition_winner_pubkey_hash" => %proposed_by.state().miner_pkh,
@@ -353,7 +353,7 @@ impl SortitionsView {
353353
warn!(
354354
"Current miner behaved improperly, this signer views the miner as invalid.";
355355
"proposed_block_consensus_hash" => %block.header.consensus_hash,
356-
"proposed_block_signer_sighash" => %block.header.signer_signature_hash(),
356+
"signer_signature_hash" => %block.header.signer_signature_hash(),
357357
);
358358
return Err(RejectReason::InvalidMiner);
359359
}
@@ -367,7 +367,7 @@ impl SortitionsView {
367367
warn!(
368368
"Miner block proposal is from last sortition winner, when the new sortition winner is still valid. Considering proposal invalid.";
369369
"proposed_block_consensus_hash" => %block.header.consensus_hash,
370-
"proposed_block_signer_sighash" => %block.header.signer_signature_hash(),
370+
"signer_signature_hash" => %block.header.signer_signature_hash(),
371371
"current_sortition_miner_status" => ?self.cur_sortition.miner_status,
372372
"last_sortition" => %last_sortition.consensus_hash
373373
);
@@ -412,7 +412,7 @@ impl SortitionsView {
412412
warn!(
413413
"Miner block proposal contains a tenure extend, but the burnchain view has not changed and enough time has not passed to refresh the block limit. Considering proposal invalid.";
414414
"proposed_block_consensus_hash" => %block.header.consensus_hash,
415-
"proposed_block_signer_sighash" => %block.header.signer_signature_hash(),
415+
"signer_signature_hash" => %block.header.signer_signature_hash(),
416416
"extend_timestamp" => extend_timestamp,
417417
"epoch_time" => epoch_time,
418418
);
@@ -443,7 +443,7 @@ impl SortitionsView {
443443
info!(
444444
"Most recent miner's tenure does not build off the prior sortition, checking if this is valid behavior";
445445
"proposed_block_consensus_hash" => %block.header.consensus_hash,
446-
"proposed_block_signer_sighash" => %block.header.signer_signature_hash(),
446+
"signer_signature_hash" => %block.header.signer_signature_hash(),
447447
"sortition_state.consensus_hash" => %sortition_state.consensus_hash,
448448
"sortition_state.prior_sortition" => %sortition_state.prior_sortition,
449449
"sortition_state.parent_tenure_id" => %sortition_state.parent_tenure_id,
@@ -457,7 +457,7 @@ impl SortitionsView {
457457
if tenures_reorged.is_empty() {
458458
warn!("Miner is not building off of most recent tenure, but stacks node was unable to return information about the relevant sortitions. Marking miner invalid.";
459459
"proposed_block_consensus_hash" => %block.header.consensus_hash,
460-
"proposed_block_signer_sighash" => %block.header.signer_signature_hash(),
460+
"signer_signature_hash" => %block.header.signer_signature_hash(),
461461
);
462462
return Ok(false);
463463
}
@@ -479,7 +479,7 @@ impl SortitionsView {
479479
warn!(
480480
"Miner is not building off of most recent tenure, but a tenure they attempted to reorg has already more than one globally accepted block.";
481481
"proposed_block_consensus_hash" => %block.header.consensus_hash,
482-
"proposed_block_signer_sighash" => %block.header.signer_signature_hash(),
482+
"signer_signature_hash" => %block.header.signer_signature_hash(),
483483
"parent_tenure" => %sortition_state.parent_tenure_id,
484484
"last_sortition" => %sortition_state.prior_sortition,
485485
"violating_tenure_id" => %tenure.consensus_hash,
@@ -496,7 +496,7 @@ impl SortitionsView {
496496
warn!(
497497
"Miner is not building off of most recent tenure, but a tenure they attempted to reorg has already mined blocks, and there is no local knowledge for that tenure's block timing.";
498498
"proposed_block_consensus_hash" => %block.header.consensus_hash,
499-
"proposed_block_signer_sighash" => %block.header.signer_signature_hash(),
499+
"signer_signature_hash" => %block.header.signer_signature_hash(),
500500
"parent_tenure" => %sortition_state.parent_tenure_id,
501501
"last_sortition" => %sortition_state.prior_sortition,
502502
"violating_tenure_id" => %tenure.consensus_hash,
@@ -523,7 +523,7 @@ impl SortitionsView {
523523
info!(
524524
"Miner is not building off of most recent tenure. A tenure they reorg has already mined blocks, but the block was poorly timed, allowing the reorg.";
525525
"proposed_block_consensus_hash" => %block.header.consensus_hash,
526-
"proposed_block_signer_sighash" => %block.header.signer_signature_hash(),
526+
"signer_signature_hash" => %block.header.signer_signature_hash(),
527527
"proposed_block_height" => block.header.chain_length,
528528
"parent_tenure" => %sortition_state.parent_tenure_id,
529529
"last_sortition" => %sortition_state.prior_sortition,
@@ -545,7 +545,7 @@ impl SortitionsView {
545545
warn!(
546546
"Miner is not building off of most recent tenure, but a tenure they attempted to reorg has already mined blocks.";
547547
"proposed_block_consensus_hash" => %block.header.consensus_hash,
548-
"proposed_block_signer_sighash" => %block.header.signer_signature_hash(),
548+
"signer_signature_hash" => %block.header.signer_signature_hash(),
549549
"parent_tenure" => %sortition_state.parent_tenure_id,
550550
"last_sortition" => %sortition_state.prior_sortition,
551551
"violating_tenure_id" => %tenure.consensus_hash,
@@ -620,7 +620,7 @@ impl SortitionsView {
620620
warn!(
621621
"Miner's block proposal does not confirm as many blocks as we expect";
622622
"proposed_block_consensus_hash" => %block.header.consensus_hash,
623-
"proposed_block_signer_sighash" => %block.header.signer_signature_hash(),
623+
"signer_signature_hash" => %block.header.signer_signature_hash(),
624624
"proposed_chain_length" => block.header.chain_length,
625625
"expected_at_least" => info.block.header.chain_length + 1,
626626
);
@@ -649,7 +649,7 @@ impl SortitionsView {
649649
warn!(
650650
"Miner block proposal contains a tenure change, but failed to fetch the tenure tip for the parent tenure: {e:?}. Considering proposal invalid.";
651651
"proposed_block_consensus_hash" => %block.header.consensus_hash,
652-
"proposed_block_signer_sighash" => %block.header.signer_signature_hash(),
652+
"signer_signature_hash" => %block.header.signer_signature_hash(),
653653
"parent_tenure" => %tenure_change.prev_tenure_consensus_hash,
654654
);
655655
return Ok(false);
@@ -677,7 +677,7 @@ impl SortitionsView {
677677
warn!(
678678
"Miner's block proposal does not confirm as many blocks as we expect";
679679
"proposed_block_consensus_hash" => %block.header.consensus_hash,
680-
"proposed_block_signer_sighash" => %block.header.signer_signature_hash(),
680+
"signer_signature_hash" => %block.header.signer_signature_hash(),
681681
"proposed_chain_length" => block.header.chain_length,
682682
"expected_at_least" => tip_height + 1,
683683
);
@@ -730,8 +730,8 @@ impl SortitionsView {
730730
warn!(
731731
"Miner block proposal contains a tenure change, but we've already signed a block in this tenure. Considering proposal invalid.";
732732
"proposed_block_consensus_hash" => %block.header.consensus_hash,
733-
"proposed_block_signer_sighash" => %block.header.signer_signature_hash(),
734-
"last_in_tenure_signer_sighash" => %last_in_current_tenure.block.header.signer_signature_hash(),
733+
"proposed_block_signer_signature_hash" => %block.header.signer_signature_hash(),
734+
"last_in_tenure_signer_signature_hash" => %last_in_current_tenure.block.header.signer_signature_hash(),
735735
);
736736
return Err(RejectReason::DuplicateBlockFound);
737737
}
@@ -749,7 +749,7 @@ impl SortitionsView {
749749
info!(
750750
"Have no accepted blocks in the tenure, assuming block confirmation is correct";
751751
"proposed_block_consensus_hash" => %block.header.consensus_hash,
752-
"proposed_block_signer_sighash" => %block.header.signer_signature_hash(),
752+
"signer_signature_hash" => %block.header.signer_signature_hash(),
753753
"proposed_block_height" => block.header.chain_length,
754754
);
755755
return Ok(true);
@@ -760,7 +760,7 @@ impl SortitionsView {
760760
warn!(
761761
"Miner's block proposal does not confirm as many blocks as we expect";
762762
"proposed_block_consensus_hash" => %block.header.consensus_hash,
763-
"proposed_block_signer_sighash" => %block.header.signer_signature_hash(),
763+
"signer_signature_hash" => %block.header.signer_signature_hash(),
764764
"proposed_chain_length" => block.header.chain_length,
765765
"expected_at_least" => last_known_block.block.header.chain_length + 1,
766766
);

stacks-signer/src/client/stacks_client.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ impl StacksClient {
314314
/// Submit the block proposal to the stacks node. The block will be validated and returned via the HTTP endpoint for Block events.
315315
pub fn submit_block_for_validation(&self, block: NakamotoBlock) -> Result<(), ClientError> {
316316
debug!("StacksClient: Submitting block for validation";
317-
"signer_sighash" => %block.header.signer_signature_hash(),
317+
"signer_signature_hash" => %block.header.signer_signature_hash(),
318318
"block_id" => %block.header.block_id(),
319319
"block_height" => %block.header.chain_length,
320320
);
@@ -598,7 +598,7 @@ impl StacksClient {
598598
/// In tests, this panics if the retry takes longer than 30 seconds.
599599
pub fn post_block_until_ok<F: Display>(&self, log_fmt: &F, block: &NakamotoBlock) -> bool {
600600
debug!("StacksClient: Posting block to stacks node";
601-
"signer_sighash" => %block.header.signer_signature_hash(),
601+
"signer_signature_hash" => %block.header.signer_signature_hash(),
602602
"block_id" => %block.header.block_id(),
603603
"block_height" => %block.header.chain_length,
604604
);
@@ -628,7 +628,7 @@ impl StacksClient {
628628
/// was rejected.
629629
pub fn post_block(&self, block: &NakamotoBlock) -> Result<bool, ClientError> {
630630
debug!("StacksClient: Posting block to the stacks node";
631-
"signer_sighash" => %block.header.signer_signature_hash(),
631+
"signer_signature_hash" => %block.header.signer_signature_hash(),
632632
"block_id" => %block.header.block_id(),
633633
"block_height" => %block.header.chain_length,
634634
);

stacks-signer/src/signerdb.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1011,7 +1011,7 @@ impl SignerDb {
10111011
debug!("Inserting block_info.";
10121012
"reward_cycle" => %block_info.reward_cycle,
10131013
"burn_block_height" => %block_info.burn_block_height,
1014-
"sighash" => %hash,
1014+
"signer_signature_hash" => %hash,
10151015
"block_id" => %block_id,
10161016
"signed" => %signed_over,
10171017
"broadcasted" => ?broadcasted,
@@ -1064,7 +1064,7 @@ impl SignerDb {
10641064
];
10651065

10661066
debug!("Inserting block signature.";
1067-
"sighash" => %block_sighash,
1067+
"signer_signature_hash" => %block_sighash,
10681068
"signature" => %signature);
10691069

10701070
self.db.execute(qry, args)?;
@@ -1100,7 +1100,7 @@ impl SignerDb {
11001100
];
11011101

11021102
debug!("Inserting block rejection.";
1103-
"block_sighash" => %block_sighash,
1103+
"signer_signature_hash" => %block_sighash,
11041104
"signer_address" => %addr,
11051105
"reject_reason" => %reject_reason
11061106
);

0 commit comments

Comments
 (0)