Skip to content

Commit

Permalink
more logging
Browse files Browse the repository at this point in the history
  • Loading branch information
JesseAbram committed Nov 22, 2024
1 parent 0f5dbd9 commit 79333f8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion crates/threshold-signature-server/src/helpers/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ pub async fn do_jump_start(
assert_eq!(format!("{:?}", jump_start_status), format!("{:?}", JumpStartStatus::Done));
}

async fn log_all_block_numbers(other_chains: &[LegacyRpcMethods<EntropyConfig>]) {
pub async fn log_all_block_numbers(other_chains: &[LegacyRpcMethods<EntropyConfig>]) {
for (i, other_chain) in other_chains.iter().enumerate() {
let block_number = other_chain.chain_get_header(None).await.unwrap().unwrap().number;
tracing::info!("Block number for rpc `{}`: `{}`", i, block_number);
Expand Down
2 changes: 2 additions & 0 deletions crates/threshold-signature-server/src/validator/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,8 @@ pub async fn validate_new_reshare(

// we subtract 1 as the message info is coming from the previous block
if latest_block_number.saturating_sub(1) != chain_data.block_number {
tracing::info!("latest_block_number: {}", latest_block_number.saturating_sub(1));
tracing::info!("chain_data.block_number: {}", chain_data.block_number);
return Err(ValidatorErr::StaleData);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ use entropy_testing_utils::{
},
spawn_testing_validators, test_node_process_testing_state, ChainSpecType,
};
use entropy_tss::helpers::tests::{do_jump_start, initialize_test_logger, run_to_block};
use entropy_tss::helpers::tests::{do_jump_start, initialize_test_logger, run_to_block, log_all_block_numbers};
use futures::future::join_all;
use serial_test::serial;
use sp_core::{Encode, Pair};
Expand Down Expand Up @@ -175,6 +175,7 @@ async fn do_reshare(
run_to_all_blocks(rpcs, block_number).await;
// Send the OCW message to all TS servers who don't have a chain node
let client = reqwest::Client::new();
log_all_block_numbers(rpcs).await;
let response_results = join_all(
ips.iter()
.map(|port| {
Expand Down

0 comments on commit 79333f8

Please sign in to comment.