Skip to content

Commit 4b1b020

Browse files
committed
consolidate label for signer_signature_hash
1 parent ba81886 commit 4b1b020

File tree

11 files changed

+75
-71
lines changed

11 files changed

+75
-71
lines changed

libsigner/src/v0/messages.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -873,14 +873,14 @@ impl std::fmt::Display for BlockResponse {
873873
BlockResponse::Accepted(a) => {
874874
write!(
875875
f,
876-
"BlockAccepted: signer_sighash = {}, signature = {}, version = {}",
876+
"BlockAccepted: signer_signature_hash = {}, signature = {}, version = {}",
877877
a.signer_signature_hash, a.signature, a.metadata.server_version
878878
)
879879
}
880880
BlockResponse::Rejected(r) => {
881881
write!(
882882
f,
883-
"BlockRejected: signer_sighash = {}, code = {}, reason = {}, signature = {}, version = {}",
883+
"BlockRejected: signer_signature_hash = {}, code = {}, reason = {}, signature = {}, version = {}",
884884
r.reason_code, r.reason, r.signer_signature_hash, r.signature, r.metadata.server_version
885885
)
886886
}

stacks-signer/src/chainstate.rs

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ impl SortitionsView {
284284
warn!(
285285
"Miner block proposal has bitvec field which punishes in disagreement with signer. Considering invalid.";
286286
"proposed_block_consensus_hash" => %block.header.consensus_hash,
287-
"proposed_block_signer_sighash" => %block.header.signer_signature_hash(),
287+
"proposed_block_signer_signature_hash" => %block.header.signer_signature_hash(),
288288
"current_sortition_consensus_hash" => ?self.cur_sortition.consensus_hash,
289289
"last_sortition_consensus_hash" => ?self.last_sortition.as_ref().map(|x| x.consensus_hash),
290290
);
@@ -322,7 +322,7 @@ impl SortitionsView {
322322
warn!(
323323
"Miner block proposal has consensus hash that is neither the current or last sortition. Considering invalid.";
324324
"proposed_block_consensus_hash" => %block.header.consensus_hash,
325-
"proposed_block_signer_sighash" => %block.header.signer_signature_hash(),
325+
"proposed_block_signer_signature_hash" => %block.header.signer_signature_hash(),
326326
"current_sortition_consensus_hash" => ?self.cur_sortition.consensus_hash,
327327
"last_sortition_consensus_hash" => ?self.last_sortition.as_ref().map(|x| x.consensus_hash),
328328
);
@@ -333,7 +333,7 @@ impl SortitionsView {
333333
warn!(
334334
"Miner block proposal pubkey does not match the winning pubkey hash for its sortition. Considering invalid.";
335335
"proposed_block_consensus_hash" => %block.header.consensus_hash,
336-
"proposed_block_signer_sighash" => %block.header.signer_signature_hash(),
336+
"proposed_block_signer_signature_hash" => %block.header.signer_signature_hash(),
337337
"proposed_block_pubkey" => &block_pk.to_hex(),
338338
"proposed_block_pubkey_hash" => %block_pkh,
339339
"sortition_winner_pubkey_hash" => %proposed_by.state().miner_pkh,
@@ -348,7 +348,7 @@ impl SortitionsView {
348348
warn!(
349349
"Current miner behaved improperly, this signer views the miner as invalid.";
350350
"proposed_block_consensus_hash" => %block.header.consensus_hash,
351-
"proposed_block_signer_sighash" => %block.header.signer_signature_hash(),
351+
"proposed_block_signer_signature_hash" => %block.header.signer_signature_hash(),
352352
);
353353
return Err(RejectReason::InvalidMiner);
354354
}
@@ -362,7 +362,7 @@ impl SortitionsView {
362362
warn!(
363363
"Miner block proposal is from last sortition winner, when the new sortition winner is still valid. Considering proposal invalid.";
364364
"proposed_block_consensus_hash" => %block.header.consensus_hash,
365-
"proposed_block_signer_sighash" => %block.header.signer_signature_hash(),
365+
"proposed_block_signer_signature_hash" => %block.header.signer_signature_hash(),
366366
"current_sortition_miner_status" => ?self.cur_sortition.miner_status,
367367
"last_sortition" => %last_sortition.consensus_hash
368368
);
@@ -407,7 +407,7 @@ impl SortitionsView {
407407
warn!(
408408
"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.";
409409
"proposed_block_consensus_hash" => %block.header.consensus_hash,
410-
"proposed_block_signer_sighash" => %block.header.signer_signature_hash(),
410+
"proposed_block_signer_signature_hash" => %block.header.signer_signature_hash(),
411411
"extend_timestamp" => extend_timestamp,
412412
"epoch_time" => epoch_time,
413413
);
@@ -435,7 +435,7 @@ impl SortitionsView {
435435
info!(
436436
"Most recent miner's tenure does not build off the prior sortition, checking if this is valid behavior";
437437
"proposed_block_consensus_hash" => %block.header.consensus_hash,
438-
"proposed_block_signer_sighash" => %block.header.signer_signature_hash(),
438+
"proposed_block_signer_signature_hash" => %block.header.signer_signature_hash(),
439439
"sortition_state.consensus_hash" => %sortition_state.consensus_hash,
440440
"sortition_state.prior_sortition" => %sortition_state.prior_sortition,
441441
"sortition_state.parent_tenure_id" => %sortition_state.parent_tenure_id,
@@ -449,7 +449,7 @@ impl SortitionsView {
449449
if tenures_reorged.is_empty() {
450450
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.";
451451
"proposed_block_consensus_hash" => %block.header.consensus_hash,
452-
"proposed_block_signer_sighash" => %block.header.signer_signature_hash(),
452+
"proposed_block_signer_signature_hash" => %block.header.signer_signature_hash(),
453453
);
454454
return Ok(false);
455455
}
@@ -471,7 +471,7 @@ impl SortitionsView {
471471
warn!(
472472
"Miner is not building off of most recent tenure, but a tenure they attempted to reorg has already more than one globally accepted block.";
473473
"proposed_block_consensus_hash" => %block.header.consensus_hash,
474-
"proposed_block_signer_sighash" => %block.header.signer_signature_hash(),
474+
"proposed_block_signer_signature_hash" => %block.header.signer_signature_hash(),
475475
"parent_tenure" => %sortition_state.parent_tenure_id,
476476
"last_sortition" => %sortition_state.prior_sortition,
477477
"violating_tenure_id" => %tenure.consensus_hash,
@@ -488,7 +488,7 @@ impl SortitionsView {
488488
warn!(
489489
"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.";
490490
"proposed_block_consensus_hash" => %block.header.consensus_hash,
491-
"proposed_block_signer_sighash" => %block.header.signer_signature_hash(),
491+
"proposed_block_signer_signature_hash" => %block.header.signer_signature_hash(),
492492
"parent_tenure" => %sortition_state.parent_tenure_id,
493493
"last_sortition" => %sortition_state.prior_sortition,
494494
"violating_tenure_id" => %tenure.consensus_hash,
@@ -515,7 +515,7 @@ impl SortitionsView {
515515
info!(
516516
"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.";
517517
"proposed_block_consensus_hash" => %block.header.consensus_hash,
518-
"proposed_block_signer_sighash" => %block.header.signer_signature_hash(),
518+
"proposed_block_signer_signature_hash" => %block.header.signer_signature_hash(),
519519
"proposed_block_height" => block.header.chain_length,
520520
"parent_tenure" => %sortition_state.parent_tenure_id,
521521
"last_sortition" => %sortition_state.prior_sortition,
@@ -537,7 +537,7 @@ impl SortitionsView {
537537
warn!(
538538
"Miner is not building off of most recent tenure, but a tenure they attempted to reorg has already mined blocks.";
539539
"proposed_block_consensus_hash" => %block.header.consensus_hash,
540-
"proposed_block_signer_sighash" => %block.header.signer_signature_hash(),
540+
"proposed_block_signer_signature_hash" => %block.header.signer_signature_hash(),
541541
"parent_tenure" => %sortition_state.parent_tenure_id,
542542
"last_sortition" => %sortition_state.prior_sortition,
543543
"violating_tenure_id" => %tenure.consensus_hash,
@@ -612,7 +612,7 @@ impl SortitionsView {
612612
warn!(
613613
"Miner's block proposal does not confirm as many blocks as we expect";
614614
"proposed_block_consensus_hash" => %block.header.consensus_hash,
615-
"proposed_block_signer_sighash" => %block.header.signer_signature_hash(),
615+
"proposed_block_signer_signature_hash" => %block.header.signer_signature_hash(),
616616
"proposed_chain_length" => block.header.chain_length,
617617
"expected_at_least" => info.block.header.chain_length + 1,
618618
);
@@ -641,7 +641,7 @@ impl SortitionsView {
641641
warn!(
642642
"Miner block proposal contains a tenure change, but failed to fetch the tenure tip for the parent tenure: {e:?}. Considering proposal invalid.";
643643
"proposed_block_consensus_hash" => %block.header.consensus_hash,
644-
"proposed_block_signer_sighash" => %block.header.signer_signature_hash(),
644+
"proposed_block_signer_signature_hash" => %block.header.signer_signature_hash(),
645645
"parent_tenure" => %tenure_change.prev_tenure_consensus_hash,
646646
);
647647
return Ok(false);
@@ -669,7 +669,7 @@ impl SortitionsView {
669669
warn!(
670670
"Miner's block proposal does not confirm as many blocks as we expect";
671671
"proposed_block_consensus_hash" => %block.header.consensus_hash,
672-
"proposed_block_signer_sighash" => %block.header.signer_signature_hash(),
672+
"proposed_block_signer_signature_hash" => %block.header.signer_signature_hash(),
673673
"proposed_chain_length" => block.header.chain_length,
674674
"expected_at_least" => tip_height + 1,
675675
);
@@ -722,8 +722,8 @@ impl SortitionsView {
722722
warn!(
723723
"Miner block proposal contains a tenure change, but we've already signed a block in this tenure. Considering proposal invalid.";
724724
"proposed_block_consensus_hash" => %block.header.consensus_hash,
725-
"proposed_block_signer_sighash" => %block.header.signer_signature_hash(),
726-
"last_in_tenure_signer_sighash" => %last_in_current_tenure.block.header.signer_signature_hash(),
725+
"proposed_block_signer_signature_hash" => %block.header.signer_signature_hash(),
726+
"last_in_tenure_signer_signature_hash" => %last_in_current_tenure.block.header.signer_signature_hash(),
727727
);
728728
return Err(RejectReason::DuplicateBlockFound);
729729
}
@@ -741,7 +741,7 @@ impl SortitionsView {
741741
info!(
742742
"Have no accepted blocks in the tenure, assuming block confirmation is correct";
743743
"proposed_block_consensus_hash" => %block.header.consensus_hash,
744-
"proposed_block_signer_sighash" => %block.header.signer_signature_hash(),
744+
"proposed_block_signer_signature_hash" => %block.header.signer_signature_hash(),
745745
"proposed_block_height" => block.header.chain_length,
746746
);
747747
return Ok(true);
@@ -752,7 +752,7 @@ impl SortitionsView {
752752
warn!(
753753
"Miner's block proposal does not confirm as many blocks as we expect";
754754
"proposed_block_consensus_hash" => %block.header.consensus_hash,
755-
"proposed_block_signer_sighash" => %block.header.signer_signature_hash(),
755+
"proposed_block_signer_signature_hash" => %block.header.signer_signature_hash(),
756756
"proposed_chain_length" => block.header.chain_length,
757757
"expected_at_least" => last_known_block.block.header.chain_length + 1,
758758
);

stacks-signer/src/client/stacks_client.rs

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

stacks-signer/src/signerdb.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -963,7 +963,7 @@ impl SignerDb {
963963
debug!("Inserting block_info.";
964964
"reward_cycle" => %block_info.reward_cycle,
965965
"burn_block_height" => %block_info.burn_block_height,
966-
"sighash" => %hash,
966+
"signer_signature_hash" => %hash,
967967
"block_id" => %block_id,
968968
"signed" => %signed_over,
969969
"broadcasted" => ?broadcasted,
@@ -1016,7 +1016,7 @@ impl SignerDb {
10161016
];
10171017

10181018
debug!("Inserting block signature.";
1019-
"sighash" => %block_sighash,
1019+
"signer_signature_hash" => %block_sighash,
10201020
"signature" => %signature);
10211021

10221022
self.db.execute(qry, args)?;
@@ -1052,7 +1052,7 @@ impl SignerDb {
10521052
];
10531053

10541054
debug!("Inserting block rejection.";
1055-
"block_sighash" => %block_sighash,
1055+
"signer_signature_hash" => %block_sighash,
10561056
"signer_address" => %addr,
10571057
"reject_reason" => %reject_reason
10581058
);

0 commit comments

Comments
 (0)