diff --git a/applications/minotari_node/log4rs_sample.yml b/applications/minotari_node/log4rs_sample.yml index bb9b862b01..0fb98ea70b 100644 --- a/applications/minotari_node/log4rs_sample.yml +++ b/applications/minotari_node/log4rs_sample.yml @@ -53,7 +53,6 @@ appenders: encoder: pattern: "{d(%Y-%m-%d %H:%M:%S.%f)} [{t}] [Thread:{I}] {l:5} {m} // {f}:{L}{n}" - # An appender named "base_layer" that writes to a file with a custom pattern encoder base_layer: kind: rolling_file @@ -71,6 +70,23 @@ appenders: encoder: pattern: "{d(%Y-%m-%d %H:%M:%S.%f)} [{t}] [{X(node-public-key)},{X(node-id)}] {l:5} {m} // {f}:{L}{n}" + # An appender named "base_layer" that writes to a file with a custom pattern encoder + grpc: + kind: rolling_file + path: "{{log_dir}}/log/base_node/grpc.log" + policy: + kind: compound + trigger: + kind: size + limit: 10mb + roller: + kind: fixed_window + base: 1 + count: 5 + pattern: "{{log_dir}}/log/base_node/grpc.{}.log" + encoder: + pattern: "{d(%Y-%m-%d %H:%M:%S.%f)} {l:5} {m} // {f}:{L}{n}" + # An appender named "other" that writes to a file with a custom pattern encoder other: kind: rolling_file @@ -104,6 +120,11 @@ loggers: - other additive: false + minotari::base_node::grpc: + level: debug + appenders: + - grpc + # Route log events sent to the "core" logger to the "base_layer" appender c: level: debug diff --git a/applications/minotari_node/src/grpc/base_node_grpc_server.rs b/applications/minotari_node/src/grpc/base_node_grpc_server.rs index 7133112dca..96fae8d189 100644 --- a/applications/minotari_node/src/grpc/base_node_grpc_server.rs +++ b/applications/minotari_node/src/grpc/base_node_grpc_server.rs @@ -269,6 +269,8 @@ impl tari_rpc::base_node_server::BaseNode for BaseNodeGrpcServer { let page_iter = NonOverlappingIntegerPairIter::new(start_height, end_height.saturating_add(1), GET_DIFFICULTY_PAGE_SIZE) .map_err(|e| obscure_error_if_true(report_error_flag, Status::invalid_argument(e)))?; + + debug!(target: LOG_TARGET, "Starting GetNetworkDifficulty request from {} to {}", start_height, end_height); task::spawn(async move { for (start, end) in page_iter { // headers are returned by height diff --git a/base_layer/core/src/transactions/key_manager/inner.rs b/base_layer/core/src/transactions/key_manager/inner.rs index d223254abe..0fc1829e2b 100644 --- a/base_layer/core/src/transactions/key_manager/inner.rs +++ b/base_layer/core/src/transactions/key_manager/inner.rs @@ -206,10 +206,6 @@ where TBackend: KeyManagerBackend + 'static } pub async fn get_random_key(&self) -> Result, KeyManagerServiceError> { - #[cfg(feature = "ledger")] - { - debug!(target: LOG_TARGET, "get_random_key: wallet type {}", self.wallet_type); - } match &*self.wallet_type { WalletType::Ledger(ledger) => { #[cfg(not(feature = "ledger"))] @@ -258,10 +254,6 @@ where TBackend: KeyManagerBackend + 'static } pub async fn get_public_key_at_key_id(&self, key_id: &TariKeyId) -> Result { - #[cfg(feature = "ledger")] - { - debug!(target: LOG_TARGET, "get_public_key_at_key_id: key_id {}, wallet type {}", key_id, self.wallet_type); - } match key_id { KeyId::Managed { branch, index } => { if let WalletType::Ledger(ledger) = &*self.wallet_type { @@ -728,15 +720,6 @@ where TBackend: KeyManagerBackend + 'static secret_key_id: &TariKeyId, public_key: &PublicKey, ) -> Result { - #[cfg(feature = "ledger")] - { - debug!( - target: LOG_TARGET, - "get_diffie_hellman_shared_secret: secret_key_id {}, wallet type {}", - secret_key_id, - self.wallet_type - ); - } if let WalletType::Ledger(ledger) = &*self.wallet_type { if let KeyId::Managed { branch, index } = secret_key_id { match TransactionKeyManagerBranch::from_key(branch) { @@ -775,20 +758,10 @@ where TBackend: KeyManagerBackend + 'static secret_key_id: &TariKeyId, public_key: &PublicKey, ) -> Result>, TransactionError> { - #[cfg(feature = "ledger")] - { - debug!( - target: LOG_TARGET, - "get_diffie_hellman_stealth_domain_hasher: secret_key_id {}, wallet type {}", - secret_key_id, - self.wallet_type - ); - } match &*self.wallet_type { WalletType::Ledger(ledger) => match secret_key_id { KeyId::Managed { branch, index } => match TransactionKeyManagerBranch::from_key(branch) { TransactionKeyManagerBranch::OneSidedSenderOffset => { - debug!(target: LOG_TARGET, "get_diffie_hellman_stealth_domain_hasher: {}", self.wallet_type); #[cfg(not(feature = "ledger"))] { Err(TransactionError::LedgerNotSupported(format!( @@ -871,15 +844,6 @@ where TBackend: KeyManagerBackend + 'static txi_version: &TransactionInputVersion, script_message: &[u8; 32], ) -> Result { - #[cfg(feature = "ledger")] - { - debug!( - target: LOG_TARGET, - "get_script_signature: script_key_id {}, wallet type {}", - script_key_id, - self.wallet_type - ); - } let commitment = self.get_commitment(commitment_mask_key_id, value).await?; let commitment_private_key = self.get_private_key(commitment_mask_key_id).await?; @@ -1064,17 +1028,6 @@ where TBackend: KeyManagerBackend + 'static script_key_ids: &[TariKeyId], sender_offset_key_ids: &[TariKeyId], ) -> Result { - #[cfg(feature = "ledger")] - { - debug!( - target: LOG_TARGET, - "get_script_offset: script_key_ids {:?}, sender_offset_key_ids {:?}, wallet type {}", - script_key_ids, - sender_offset_key_ids, - self.wallet_type - ); - } - match &*self.wallet_type { WalletType::DerivedKeys | WalletType::ProvidedKeys(_) => { let mut total_script_private_key = PrivateKey::default(); @@ -1233,15 +1186,6 @@ where TBackend: KeyManagerBackend + 'static private_key_id: &TariKeyId, challenge: &[u8], ) -> Result { - #[cfg(feature = "ledger")] - { - debug!( - target: LOG_TARGET, - "sign_script_message: private_key_id {}, wallet type {}", - private_key_id, - self.wallet_type - ); - } match &*self.wallet_type { WalletType::Ledger(ledger) => { #[cfg(not(feature = "ledger"))] @@ -1287,16 +1231,6 @@ where TBackend: KeyManagerBackend + 'static nonce_key_id: &TariKeyId, challenge: &[u8; 64], ) -> Result { - #[cfg(feature = "ledger")] - { - debug!( - target: LOG_TARGET, - "sign_with_nonce_and_challenge: private_key_id {}, nonce_key_id {}, wallet type {}", - private_key_id, - nonce_key_id, - self.wallet_type - ); - } match &*self.wallet_type { WalletType::Ledger(ledger) => { #[cfg(not(feature = "ledger"))] @@ -1417,16 +1351,6 @@ where TBackend: KeyManagerBackend + 'static script: &TariScript, receiver_address: &TariAddress, ) -> Result { - #[cfg(feature = "ledger")] - { - debug!( - target: LOG_TARGET, - "get_one_sided_metadata_signature: commitment_mask_key_id {}, sender_offset_key_id {}, wallet type {}", - commitment_mask_key_id, - sender_offset_key_id, - self.wallet_type - ); - } match &*self.wallet_type { WalletType::DerivedKeys | WalletType::ProvidedKeys(_) => { let metadata_signature_message = TransactionOutput::metadata_signature_message_from_script_and_common( @@ -1456,17 +1380,11 @@ where TBackend: KeyManagerBackend + 'static #[cfg(feature = "ledger")] { let sender_offset_key_index = sender_offset_key_id.managed_index().ok_or_else(|| { - debug!(target: LOG_TARGET, "Invalid key id {:?}", sender_offset_key_id); TransactionError::KeyManagerError("Invalid index for sender offset".to_string()) })?; let commitment_mask = self.get_private_key(commitment_mask_key_id).await?; - debug!( - target: LOG_TARGET, - "get_one_sided_metadata_signature: (ledger) account {}", - ledger.account, - ); let comm_and_pub_sig = ledger_get_one_sided_metadata_signature( ledger.account, ledger.network, diff --git a/src/nodeenv b/src/nodeenv new file mode 160000 index 0000000000..a6585e9a63 --- /dev/null +++ b/src/nodeenv @@ -0,0 +1 @@ +Subproject commit a6585e9a63e1601c4a37f3a1bb8fd0722dd6b51c