@@ -173,6 +173,9 @@ impl StacksClient {
173
173
& self ,
174
174
consensus_hash : & ConsensusHash ,
175
175
) -> Result < StacksBlockHeaderTypes , ClientError > {
176
+ debug ! ( "StacksClient: Getting tenure tip" ;
177
+ "consensus_hash" => %consensus_hash,
178
+ ) ;
176
179
let send_request = || {
177
180
self . stacks_node_client
178
181
. get ( self . tenure_tip_path ( consensus_hash) )
@@ -192,6 +195,7 @@ impl StacksClient {
192
195
193
196
/// Get the last set reward cycle stored within the stackerdb contract
194
197
pub fn get_last_set_cycle ( & self ) -> Result < u128 , ClientError > {
198
+ debug ! ( "StacksClient: Getting last set cycle" ) ;
195
199
let signer_stackerdb_contract_id = boot_code_id ( SIGNERS_NAME , self . mainnet ) ;
196
200
let function_name_str = "get-last-set-cycle" ;
197
201
let function_name = ClarityName :: from ( function_name_str) ;
@@ -210,6 +214,10 @@ impl StacksClient {
210
214
stackerdb_contract : & QualifiedContractIdentifier ,
211
215
page : u32 ,
212
216
) -> Result < Vec < ( StacksAddress , u128 ) > , ClientError > {
217
+ debug ! ( "StacksClient: Getting signer slots" ;
218
+ "stackerdb_contract" => %stackerdb_contract,
219
+ "page" => page,
220
+ ) ;
213
221
let function_name_str = "stackerdb-get-signer-slots-page" ;
214
222
let function_name = ClarityName :: from ( function_name_str) ;
215
223
let function_args = & [ ClarityValue :: UInt ( page. into ( ) ) ] ;
@@ -250,6 +258,9 @@ impl StacksClient {
250
258
& self ,
251
259
reward_cycle : u64 ,
252
260
) -> Result < HashMap < StacksAddress , SignerSlotID > , ClientError > {
261
+ debug ! ( "StacksClient: Getting parsed signer slots" ;
262
+ "reward_cycle" => reward_cycle,
263
+ ) ;
253
264
let signer_set =
254
265
u32:: try_from ( reward_cycle % 2 ) . expect ( "FATAL: reward_cycle % 2 exceeds u32::MAX" ) ;
255
266
let signer_stackerdb_contract_id = boot_code_id ( SIGNERS_NAME , self . mainnet ) ;
@@ -272,6 +283,7 @@ impl StacksClient {
272
283
273
284
/// Determine the stacks node current epoch
274
285
pub fn get_node_epoch ( & self ) -> Result < StacksEpochId , ClientError > {
286
+ debug ! ( "StacksClient: Getting node epoch" ) ;
275
287
let pox_info = self . get_pox_data ( ) ?;
276
288
let burn_block_height = self . get_burn_block_height ( ) ?;
277
289
@@ -302,7 +314,7 @@ impl StacksClient {
302
314
303
315
/// Submit the block proposal to the stacks node. The block will be validated and returned via the HTTP endpoint for Block events.
304
316
pub fn submit_block_for_validation ( & self , block : NakamotoBlock ) -> Result < ( ) , ClientError > {
305
- debug ! ( "stacks_node_client : Submitting block for validation... " ;
317
+ debug ! ( "StacksClient : Submitting block for validation" ;
306
318
"signer_sighash" => %block. header. signer_signature_hash( ) ,
307
319
"block_id" => %block. header. block_id( ) ,
308
320
"block_height" => %block. header. chain_length,
@@ -337,6 +349,10 @@ impl StacksClient {
337
349
chosen_parent : & ConsensusHash ,
338
350
last_sortition : & ConsensusHash ,
339
351
) -> Result < Vec < TenureForkingInfo > , ClientError > {
352
+ debug ! ( "StacksClient: Getting tenure forking info" ;
353
+ "chosen_parent" => %chosen_parent,
354
+ "last_sortition" => %last_sortition,
355
+ ) ;
340
356
let mut tenures: VecDeque < TenureForkingInfo > =
341
357
self . get_tenure_forking_info_step ( chosen_parent, last_sortition) ?;
342
358
if tenures. is_empty ( ) {
@@ -373,7 +389,7 @@ impl StacksClient {
373
389
chosen_parent : & ConsensusHash ,
374
390
last_sortition : & ConsensusHash ,
375
391
) -> Result < VecDeque < TenureForkingInfo > , ClientError > {
376
- debug ! ( "stacks_node_client : Getting tenure forking info... " ;
392
+ debug ! ( "StacksClient : Getting tenure forking info" ;
377
393
"chosen_parent" => %chosen_parent,
378
394
"last_sortition" => %last_sortition,
379
395
) ;
@@ -402,7 +418,7 @@ impl StacksClient {
402
418
403
419
/// Get the current winning sortition and the last winning sortition
404
420
pub fn get_current_and_last_sortition ( & self ) -> Result < CurrentAndLastSortition , ClientError > {
405
- debug ! ( "stacks_node_client : Getting current and prior sortition... " ) ;
421
+ debug ! ( "StacksClient : Getting current and prior sortition" ) ;
406
422
let path = format ! ( "{}/latest_and_last" , self . sortition_info_path( ) ) ;
407
423
let timer = crate :: monitoring:: new_rpc_call_timer ( & path, & self . http_origin ) ;
408
424
let send_request = || {
@@ -443,7 +459,7 @@ impl StacksClient {
443
459
444
460
/// Get the current peer info data from the stacks node
445
461
pub fn get_peer_info ( & self ) -> Result < PeerInfo , ClientError > {
446
- debug ! ( "stacks_node_client : Getting peer info... " ) ;
462
+ debug ! ( "StacksClient : Getting peer info" ) ;
447
463
let timer =
448
464
crate :: monitoring:: new_rpc_call_timer ( & self . core_info_path ( ) , & self . http_origin ) ;
449
465
let send_request = || {
@@ -466,7 +482,9 @@ impl StacksClient {
466
482
& self ,
467
483
reward_cycle : u64 ,
468
484
) -> Result < Option < Vec < NakamotoSignerEntry > > , ClientError > {
469
- debug ! ( "stacks_node_client: Getting reward set signers for reward cycle {reward_cycle}..." ) ;
485
+ debug ! ( "StacksClient: Getting reward set signers" ;
486
+ "reward_cycle" => reward_cycle,
487
+ ) ;
470
488
let timer = crate :: monitoring:: new_rpc_call_timer (
471
489
& format ! ( "{}/v3/stacker_set/:reward_cycle" , self . http_origin) ,
472
490
& self . http_origin ,
@@ -502,7 +520,7 @@ impl StacksClient {
502
520
503
521
/// Retrieve the current pox data from the stacks node
504
522
pub fn get_pox_data ( & self ) -> Result < RPCPoxInfoData , ClientError > {
505
- debug ! ( "stacks_node_client : Getting pox data... " ) ;
523
+ debug ! ( "StacksClient : Getting pox data" ) ;
506
524
let timer = crate :: monitoring:: new_rpc_call_timer ( & self . pox_path ( ) , & self . http_origin ) ;
507
525
let send_request = || {
508
526
self . stacks_node_client
@@ -521,11 +539,13 @@ impl StacksClient {
521
539
522
540
/// Helper function to retrieve the burn tip height from the stacks node
523
541
fn get_burn_block_height ( & self ) -> Result < u64 , ClientError > {
542
+ debug ! ( "StacksClient: Getting burn block height" ) ;
524
543
self . get_peer_info ( ) . map ( |info| info. burn_block_height )
525
544
}
526
545
527
546
/// Get the current reward cycle info from the stacks node
528
547
pub fn get_current_reward_cycle_info ( & self ) -> Result < RewardCycleInfo , ClientError > {
548
+ debug ! ( "StacksClient: Getting current reward cycle info" ) ;
529
549
let pox_data = self . get_pox_data ( ) ?;
530
550
let blocks_mined = pox_data
531
551
. current_burnchain_block_height
@@ -548,7 +568,9 @@ impl StacksClient {
548
568
& self ,
549
569
address : & StacksAddress ,
550
570
) -> Result < AccountEntryResponse , ClientError > {
551
- debug ! ( "stacks_node_client: Getting account info..." ) ;
571
+ debug ! ( "StacksClient: Getting account info" ;
572
+ "address" => %address,
573
+ ) ;
552
574
let timer_label = format ! ( "{}/v2/accounts/:principal" , self . http_origin) ;
553
575
let timer = crate :: monitoring:: new_rpc_call_timer ( & timer_label, & self . http_origin ) ;
554
576
let send_request = || {
@@ -570,6 +592,11 @@ impl StacksClient {
570
592
///
571
593
/// In tests, this panics if the retry takes longer than 30 seconds.
572
594
pub fn post_block_until_ok < F : Display > ( & self , log_fmt : & F , block : & NakamotoBlock ) -> bool {
595
+ debug ! ( "StacksClient: Posting block to stacks node" ;
596
+ "signer_sighash" => %block. header. signer_signature_hash( ) ,
597
+ "block_id" => %block. header. block_id( ) ,
598
+ "block_height" => %block. header. chain_length,
599
+ ) ;
573
600
let start_time = Instant :: now ( ) ;
574
601
loop {
575
602
match self . post_block ( block) {
@@ -595,7 +622,8 @@ impl StacksClient {
595
622
/// Returns `true` if the block was accepted or `false` if the block
596
623
/// was rejected.
597
624
pub fn post_block ( & self , block : & NakamotoBlock ) -> Result < bool , ClientError > {
598
- debug ! ( "stacks_node_client: Posting block to the stacks node..." ;
625
+ debug ! ( "StacksClient: Posting block to the stacks node" ;
626
+ "signer_sighash" => %block. header. signer_signature_hash( ) ,
599
627
"block_id" => %block. header. block_id( ) ,
600
628
"block_height" => %block. header. chain_length,
601
629
) ;
@@ -630,7 +658,9 @@ impl StacksClient {
630
658
function_name : & ClarityName ,
631
659
function_args : & [ ClarityValue ] ,
632
660
) -> Result < ClarityValue , ClientError > {
633
- debug ! ( "stacks_node_client: Calling read-only function {function_name} with args {function_args:?}..." ) ;
661
+ debug ! (
662
+ "StacksClient: Calling read-only function {function_name} with args {function_args:?}"
663
+ ) ;
634
664
let args = function_args
635
665
. iter ( )
636
666
. filter_map ( |arg| arg. serialize_to_hex ( ) . ok ( ) )
0 commit comments