From 3ed89bd2207be1a0fcd14ae7f9b7d33d5aea7b18 Mon Sep 17 00:00:00 2001 From: "B. Yap" <2826165+b-yap@users.noreply.github.com> Date: Mon, 13 Nov 2023 20:44:57 +0800 Subject: [PATCH] 262 audit pdm 011 logging in runtime (#345) * change warn to trace * change warn to trace --- node/src/command.rs | 4 ++-- runtime/amplitude/src/xcm_config.rs | 2 +- runtime/development/src/xcm_config.rs | 2 +- runtime/foucoco/src/lib.rs | 18 +++++++++--------- runtime/foucoco/src/xcm_config.rs | 2 +- runtime/integration-tests/src/sibling.rs | 2 +- runtime/pendulum/src/xcm_config.rs | 2 +- 7 files changed, 16 insertions(+), 16 deletions(-) diff --git a/node/src/command.rs b/node/src/command.rs index fe0a5d867..58b3fad62 100644 --- a/node/src/command.rs +++ b/node/src/command.rs @@ -4,7 +4,7 @@ use codec::Encode; use cumulus_client_cli::generate_genesis_block; use cumulus_primitives_core::ParaId; use frame_benchmarking_cli::{BenchmarkCmd, SUBSTRATE_REFERENCE_HARDWARE}; -use log::{info, warn}; +use log::{info, trace}; use runtime_common::opaque::Block; use sc_chain_spec::GenericChainSpec; use sc_cli::{ @@ -452,7 +452,7 @@ pub fn run() -> Result<()> { info!("Is collating: {}", if config.role.is_authority() { "yes" } else { "no" }); if !collator_options.relay_chain_rpc_urls.is_empty() && cli.relay_chain_args.len() > 0 { - warn!("Detected relay chain node arguments together with --relay-chain-rpc-url. This command starts a minimal Polkadot node that only uses a network-related subset of all relay chain CLI options."); + trace!("Detected relay chain node arguments together with --relay-chain-rpc-url. This command starts a minimal Polkadot node that only uses a network-related subset of all relay chain CLI options."); } let res = match config.chain_spec.identify() { diff --git a/runtime/amplitude/src/xcm_config.rs b/runtime/amplitude/src/xcm_config.rs index 473b3ca5b..cf66826cb 100644 --- a/runtime/amplitude/src/xcm_config.rs +++ b/runtime/amplitude/src/xcm_config.rs @@ -255,7 +255,7 @@ impl ShouldExecute for DenyReserveTransferToRelayChain { if matches!(origin, MultiLocation { parents: 1, interior: Here }) && instructions.iter().any(|inst| matches!(inst, ReserveAssetDeposited { .. })) { - log::warn!( + log::trace!( target: "xcm::barriers", "Unexpected ReserveAssetDeposited from the relay chain", ); diff --git a/runtime/development/src/xcm_config.rs b/runtime/development/src/xcm_config.rs index a313bc9f0..abfb86d01 100644 --- a/runtime/development/src/xcm_config.rs +++ b/runtime/development/src/xcm_config.rs @@ -145,7 +145,7 @@ impl ShouldExecute for DenyReserveTransferToRelayChain { if matches!(origin, MultiLocation { parents: 1, interior: Here }) && instructions.iter().any(|inst| matches!(inst, ReserveAssetDeposited { .. })) { - log::warn!( + log::trace!( target: "xcm::barriers", "Unexpected ReserveAssetDeposited from the relay chain", ); diff --git a/runtime/foucoco/src/lib.rs b/runtime/foucoco/src/lib.rs index 89da3dec3..fec77a8ec 100644 --- a/runtime/foucoco/src/lib.rs +++ b/runtime/foucoco/src/lib.rs @@ -104,7 +104,7 @@ use orml_currencies_allowance_extension::{ }; use frame_support::{ - log::{error, warn}, + log::{error, trace}, pallet_prelude::*, traits::InstanceFilter, }; @@ -979,7 +979,7 @@ where { let func_id = env.func_id(); - warn!("Calling function with ID {} from Psp22Extension", func_id); + trace!("Calling function with ID {} from Psp22Extension", func_id); // debug_message weight is a good approximation of the additional overhead of going // from contract layer to substrate layer. @@ -1001,7 +1001,7 @@ where let currency_id: CurrencyId = chain_ext::decode(input) .map_err(|_| DispatchError::Other("ChainExtension failed to decode input"))?; - warn!("Calling totalSupply() for currency {:?}", currency_id); + trace!("Calling totalSupply() for currency {:?}", currency_id); ensure!( orml_currencies_allowance_extension::Pallet::::is_allowed_currency( @@ -1030,7 +1030,7 @@ where DispatchError::Other("ChainExtension failed to decode input") })?; - warn!( + trace!( "Calling balanceOf() for currency {:?} and account {:?}", currency_id, account_id ); @@ -1069,7 +1069,7 @@ where ) = chain_ext::decode(input) .map_err(|_| DispatchError::Other("ChainExtension failed to decode input"))?; - warn!( + trace!( "Calling transfer() sending {:?} {:?}, from {:?} to {:?}", amount, currency_id, caller, recipient ); @@ -1099,7 +1099,7 @@ where DispatchError::Other("ChainExtension failed to decode input") })?; - warn!( + trace!( "Calling allowance() for currency {:?}, owner {:?} and spender {:?}", currency_id, owner, spender ); @@ -1137,7 +1137,7 @@ where ) = chain_ext::decode(input) .map_err(|_| DispatchError::Other("ChainExtension failed to decode input"))?; - warn!( + trace!( "Calling approve() allowing spender {:?} to transfer {:?} {:?} from {:?}", spender, amount, currency_id, caller ); @@ -1174,7 +1174,7 @@ where ) = chain_ext::decode(input) .map_err(|_| DispatchError::Other("ChainExtension failed to decode input"))?; - warn!( + trace!( "Calling transfer_from() for caller {:?}, sending {:?} {:?}, from {:?} to {:?}", caller, amount, currency_id, owner, recipient ); @@ -1207,7 +1207,7 @@ where symbol.to_trimmed_vec(), ); - warn!("Calling get_coin_info() for: {:?}:{:?}", blockchain, symbol); + trace!("Calling get_coin_info() for: {:?}:{:?}", blockchain, symbol); let result = match result { Ok(coin_info) => diff --git a/runtime/foucoco/src/xcm_config.rs b/runtime/foucoco/src/xcm_config.rs index 0486e76dc..047a9666f 100644 --- a/runtime/foucoco/src/xcm_config.rs +++ b/runtime/foucoco/src/xcm_config.rs @@ -252,7 +252,7 @@ impl ShouldExecute for DenyReserveTransferToRelayChain { if matches!(origin, MultiLocation { parents: 1, interior: Here }) && instructions.iter().any(|inst| matches!(inst, ReserveAssetDeposited { .. })) { - log::warn!( + log::trace!( target: "xcm::barriers", "Unexpected ReserveAssetDeposited from the relay chain", ); diff --git a/runtime/integration-tests/src/sibling.rs b/runtime/integration-tests/src/sibling.rs index 90c565489..fcca7bdca 100644 --- a/runtime/integration-tests/src/sibling.rs +++ b/runtime/integration-tests/src/sibling.rs @@ -317,7 +317,7 @@ impl ShouldExecute for DenyReserveTransferToRelayChain { if matches!(origin, MultiLocation { parents: 1, interior: Here }) && instructions.iter().any(|inst| matches!(inst, ReserveAssetDeposited { .. })) { - log::warn!( + log::trace!( target: "xcm::barriers", "Unexpected ReserveAssetDeposited from the relay chain", ); diff --git a/runtime/pendulum/src/xcm_config.rs b/runtime/pendulum/src/xcm_config.rs index dd16d4f26..03c1ede01 100644 --- a/runtime/pendulum/src/xcm_config.rs +++ b/runtime/pendulum/src/xcm_config.rs @@ -256,7 +256,7 @@ impl ShouldExecute for DenyReserveTransferToRelayChain { if matches!(origin, MultiLocation { parents: 1, interior: Here }) && instructions.iter().any(|inst| matches!(inst, ReserveAssetDeposited { .. })) { - log::warn!( + log::trace!( target: "xcm::barriers", "Unexpected ReserveAssetDeposited from the relay chain", );