From 6c1263e000ec4efbaf5f06a86cae79a2488c2cc2 Mon Sep 17 00:00:00 2001 From: Alexey Shekhirin Date: Mon, 5 Feb 2024 19:42:32 +0000 Subject: [PATCH] fix(tracing): prioritize `RUST_LOG` and verbosity CLI arg (#6413) --- book/cli/reth.md | 2 +- book/cli/reth/config.md | 2 +- book/cli/reth/db.md | 2 +- book/cli/reth/db/clear.md | 2 +- book/cli/reth/db/diff.md | 2 +- book/cli/reth/db/drop.md | 2 +- book/cli/reth/db/get.md | 2 +- book/cli/reth/db/list.md | 2 +- book/cli/reth/db/path.md | 2 +- book/cli/reth/db/snapshot.md | 2 +- book/cli/reth/db/stats.md | 2 +- book/cli/reth/db/version.md | 2 +- book/cli/reth/debug.md | 2 +- book/cli/reth/import.md | 2 +- book/cli/reth/init.md | 2 +- book/cli/reth/node.md | 12 ++++++++++-- book/cli/reth/p2p.md | 2 +- book/cli/reth/p2p/body.md | 2 +- book/cli/reth/p2p/header.md | 2 +- book/cli/reth/recover.md | 2 +- book/cli/reth/recover/storage-tries.md | 2 +- book/cli/reth/stage.md | 2 +- book/cli/reth/stage/drop.md | 2 +- book/cli/reth/stage/dump.md | 2 +- book/cli/reth/stage/dump/account-hashing.md | 2 +- book/cli/reth/stage/dump/execution.md | 2 +- book/cli/reth/stage/dump/merkle.md | 2 +- book/cli/reth/stage/dump/storage-hashing.md | 2 +- book/cli/reth/stage/run.md | 2 +- book/cli/reth/stage/unwind.md | 2 +- book/cli/reth/stage/unwind/num-blocks.md | 2 +- book/cli/reth/stage/unwind/to-block.md | 2 +- book/cli/reth/test-vectors.md | 2 +- book/cli/reth/test-vectors/tables.md | 2 +- crates/consensus/common/src/validation.rs | 8 ++++---- crates/ethereum-forks/src/hardfork.rs | 4 ++-- crates/net/network/src/transactions/fetcher.rs | 2 +- crates/node-core/src/args/log_args.rs | 9 ++------- crates/storage/libmdbx-rs/src/error.rs | 2 +- crates/tracing/src/layers.rs | 8 ++++---- crates/tracing/src/lib.rs | 18 ++++++++---------- crates/transaction-pool/src/lib.rs | 2 +- crates/transaction-pool/src/pool/best.rs | 2 +- crates/transaction-pool/src/test_utils/mock.rs | 4 ++-- examples/polygon-p2p/src/main.rs | 4 ++-- 45 files changed, 71 insertions(+), 70 deletions(-) diff --git a/book/cli/reth.md b/book/cli/reth.md index e0aa8c659..d0c57788f 100644 --- a/book/cli/reth.md +++ b/book/cli/reth.md @@ -60,7 +60,7 @@ Logging: --log.stdout.filter The filter to use for logs written to stdout - [default: info] + [default: ] --log.file.format The format to use for logs written to the log file diff --git a/book/cli/reth/config.md b/book/cli/reth/config.md index fbd5e42a3..eba35a9fa 100644 --- a/book/cli/reth/config.md +++ b/book/cli/reth/config.md @@ -50,7 +50,7 @@ Logging: --log.stdout.filter The filter to use for logs written to stdout - [default: info] + [default: ] --log.file.format The format to use for logs written to the log file diff --git a/book/cli/reth/db.md b/book/cli/reth/db.md index 272b14659..158b4b726 100644 --- a/book/cli/reth/db.md +++ b/book/cli/reth/db.md @@ -81,7 +81,7 @@ Logging: --log.stdout.filter The filter to use for logs written to stdout - [default: info] + [default: ] --log.file.format The format to use for logs written to the log file diff --git a/book/cli/reth/db/clear.md b/book/cli/reth/db/clear.md index 249c29461..c8dd59583 100644 --- a/book/cli/reth/db/clear.md +++ b/book/cli/reth/db/clear.md @@ -59,7 +59,7 @@ Logging: --log.stdout.filter The filter to use for logs written to stdout - [default: info] + [default: ] --log.file.format The format to use for logs written to the log file diff --git a/book/cli/reth/db/diff.md b/book/cli/reth/db/diff.md index 120cd949e..6923980fe 100644 --- a/book/cli/reth/db/diff.md +++ b/book/cli/reth/db/diff.md @@ -78,7 +78,7 @@ Logging: --log.stdout.filter The filter to use for logs written to stdout - [default: info] + [default: ] --log.file.format The format to use for logs written to the log file diff --git a/book/cli/reth/db/drop.md b/book/cli/reth/db/drop.md index a0ba3b1bd..080ea2569 100644 --- a/book/cli/reth/db/drop.md +++ b/book/cli/reth/db/drop.md @@ -58,7 +58,7 @@ Logging: --log.stdout.filter The filter to use for logs written to stdout - [default: info] + [default: ] --log.file.format The format to use for logs written to the log file diff --git a/book/cli/reth/db/get.md b/book/cli/reth/db/get.md index 6c8ca30ad..17b155eaa 100644 --- a/book/cli/reth/db/get.md +++ b/book/cli/reth/db/get.md @@ -70,7 +70,7 @@ Logging: --log.stdout.filter The filter to use for logs written to stdout - [default: info] + [default: ] --log.file.format The format to use for logs written to the log file diff --git a/book/cli/reth/db/list.md b/book/cli/reth/db/list.md index f1ae85228..a7d88eb51 100644 --- a/book/cli/reth/db/list.md +++ b/book/cli/reth/db/list.md @@ -101,7 +101,7 @@ Logging: --log.stdout.filter The filter to use for logs written to stdout - [default: info] + [default: ] --log.file.format The format to use for logs written to the log file diff --git a/book/cli/reth/db/path.md b/book/cli/reth/db/path.md index f39fd11b4..dc8733ef1 100644 --- a/book/cli/reth/db/path.md +++ b/book/cli/reth/db/path.md @@ -55,7 +55,7 @@ Logging: --log.stdout.filter The filter to use for logs written to stdout - [default: info] + [default: ] --log.file.format The format to use for logs written to the log file diff --git a/book/cli/reth/db/snapshot.md b/book/cli/reth/db/snapshot.md index 761b66bc2..8e4aef501 100644 --- a/book/cli/reth/db/snapshot.md +++ b/book/cli/reth/db/snapshot.md @@ -109,7 +109,7 @@ Logging: --log.stdout.filter The filter to use for logs written to stdout - [default: info] + [default: ] --log.file.format The format to use for logs written to the log file diff --git a/book/cli/reth/db/stats.md b/book/cli/reth/db/stats.md index 411021b0a..8fa61d1a8 100644 --- a/book/cli/reth/db/stats.md +++ b/book/cli/reth/db/stats.md @@ -55,7 +55,7 @@ Logging: --log.stdout.filter The filter to use for logs written to stdout - [default: info] + [default: ] --log.file.format The format to use for logs written to the log file diff --git a/book/cli/reth/db/version.md b/book/cli/reth/db/version.md index d673f53f1..546b0a93b 100644 --- a/book/cli/reth/db/version.md +++ b/book/cli/reth/db/version.md @@ -55,7 +55,7 @@ Logging: --log.stdout.filter The filter to use for logs written to stdout - [default: info] + [default: ] --log.file.format The format to use for logs written to the log file diff --git a/book/cli/reth/debug.md b/book/cli/reth/debug.md index 5aca4e6ca..54e38dbec 100644 --- a/book/cli/reth/debug.md +++ b/book/cli/reth/debug.md @@ -52,7 +52,7 @@ Logging: --log.stdout.filter The filter to use for logs written to stdout - [default: info] + [default: ] --log.file.format The format to use for logs written to the log file diff --git a/book/cli/reth/import.md b/book/cli/reth/import.md index 49abf1774..6461e6a3f 100644 --- a/book/cli/reth/import.md +++ b/book/cli/reth/import.md @@ -78,7 +78,7 @@ Logging: --log.stdout.filter The filter to use for logs written to stdout - [default: info] + [default: ] --log.file.format The format to use for logs written to the log file diff --git a/book/cli/reth/init.md b/book/cli/reth/init.md index ee7453ccc..f9fb1de02 100644 --- a/book/cli/reth/init.md +++ b/book/cli/reth/init.md @@ -69,7 +69,7 @@ Logging: --log.stdout.filter The filter to use for logs written to stdout - [default: info] + [default: ] --log.file.format The format to use for logs written to the log file diff --git a/book/cli/reth/node.md b/book/cli/reth/node.md index 2f49c1590..ef643256e 100644 --- a/book/cli/reth/node.md +++ b/book/cli/reth/node.md @@ -41,6 +41,11 @@ Options: [default: 1] + --with-unused-ports + Sets all ports to unused, allowing the OS to choose random unused ports when sockets are bound. + + Mutually exclusive with `--instance`. + --trusted-setup-file Overrides the KZG trusted setup by reading from the supplied file @@ -205,7 +210,7 @@ RPC: --rpc-max-response-size Set the maximum RPC response payload size for both HTTP and WS in megabytes - [default: 150] + [default: 160] [aliases: --rpc.returndata.limit] --rpc-max-subscriptions-per-connection @@ -332,6 +337,9 @@ TxPool: --txpool.locals Flag to allow certain addresses as local + --txpool.no-local-transactions-propagation + Flag to toggle local transaction propagation + Builder: --builder.extradata Block extra data set by the payload builder @@ -441,7 +449,7 @@ Logging: --log.stdout.filter The filter to use for logs written to stdout - [default: info] + [default: ] --log.file.format The format to use for logs written to the log file diff --git a/book/cli/reth/p2p.md b/book/cli/reth/p2p.md index edc80ebbb..f5ab46224 100644 --- a/book/cli/reth/p2p.md +++ b/book/cli/reth/p2p.md @@ -115,7 +115,7 @@ Logging: --log.stdout.filter The filter to use for logs written to stdout - [default: info] + [default: ] --log.file.format The format to use for logs written to the log file diff --git a/book/cli/reth/p2p/body.md b/book/cli/reth/p2p/body.md index 5ef001c34..24d295859 100644 --- a/book/cli/reth/p2p/body.md +++ b/book/cli/reth/p2p/body.md @@ -39,7 +39,7 @@ Logging: --log.stdout.filter The filter to use for logs written to stdout - [default: info] + [default: ] --log.file.format The format to use for logs written to the log file diff --git a/book/cli/reth/p2p/header.md b/book/cli/reth/p2p/header.md index 50f210189..6cf84d903 100644 --- a/book/cli/reth/p2p/header.md +++ b/book/cli/reth/p2p/header.md @@ -39,7 +39,7 @@ Logging: --log.stdout.filter The filter to use for logs written to stdout - [default: info] + [default: ] --log.file.format The format to use for logs written to the log file diff --git a/book/cli/reth/recover.md b/book/cli/reth/recover.md index aa077c75c..3593d9b16 100644 --- a/book/cli/reth/recover.md +++ b/book/cli/reth/recover.md @@ -48,7 +48,7 @@ Logging: --log.stdout.filter The filter to use for logs written to stdout - [default: info] + [default: ] --log.file.format The format to use for logs written to the log file diff --git a/book/cli/reth/recover/storage-tries.md b/book/cli/reth/recover/storage-tries.md index 91322f6c5..778edb804 100644 --- a/book/cli/reth/recover/storage-tries.md +++ b/book/cli/reth/recover/storage-tries.md @@ -55,7 +55,7 @@ Logging: --log.stdout.filter The filter to use for logs written to stdout - [default: info] + [default: ] --log.file.format The format to use for logs written to the log file diff --git a/book/cli/reth/stage.md b/book/cli/reth/stage.md index 7c8faf3e6..a140a3518 100644 --- a/book/cli/reth/stage.md +++ b/book/cli/reth/stage.md @@ -51,7 +51,7 @@ Logging: --log.stdout.filter The filter to use for logs written to stdout - [default: info] + [default: ] --log.file.format The format to use for logs written to the log file diff --git a/book/cli/reth/stage/drop.md b/book/cli/reth/stage/drop.md index 299e49a3a..d6c912b4c 100644 --- a/book/cli/reth/stage/drop.md +++ b/book/cli/reth/stage/drop.md @@ -84,7 +84,7 @@ Logging: --log.stdout.filter The filter to use for logs written to stdout - [default: info] + [default: ] --log.file.format The format to use for logs written to the log file diff --git a/book/cli/reth/stage/dump.md b/book/cli/reth/stage/dump.md index f7887cf69..c70eba2fc 100644 --- a/book/cli/reth/stage/dump.md +++ b/book/cli/reth/stage/dump.md @@ -76,7 +76,7 @@ Logging: --log.stdout.filter The filter to use for logs written to stdout - [default: info] + [default: ] --log.file.format The format to use for logs written to the log file diff --git a/book/cli/reth/stage/dump/account-hashing.md b/book/cli/reth/stage/dump/account-hashing.md index 78a7cd412..4a575388c 100644 --- a/book/cli/reth/stage/dump/account-hashing.md +++ b/book/cli/reth/stage/dump/account-hashing.md @@ -47,7 +47,7 @@ Logging: --log.stdout.filter The filter to use for logs written to stdout - [default: info] + [default: ] --log.file.format The format to use for logs written to the log file diff --git a/book/cli/reth/stage/dump/execution.md b/book/cli/reth/stage/dump/execution.md index 4de5af8f8..4d6b0ce5d 100644 --- a/book/cli/reth/stage/dump/execution.md +++ b/book/cli/reth/stage/dump/execution.md @@ -47,7 +47,7 @@ Logging: --log.stdout.filter The filter to use for logs written to stdout - [default: info] + [default: ] --log.file.format The format to use for logs written to the log file diff --git a/book/cli/reth/stage/dump/merkle.md b/book/cli/reth/stage/dump/merkle.md index 5d595a2ca..c5c04b683 100644 --- a/book/cli/reth/stage/dump/merkle.md +++ b/book/cli/reth/stage/dump/merkle.md @@ -47,7 +47,7 @@ Logging: --log.stdout.filter The filter to use for logs written to stdout - [default: info] + [default: ] --log.file.format The format to use for logs written to the log file diff --git a/book/cli/reth/stage/dump/storage-hashing.md b/book/cli/reth/stage/dump/storage-hashing.md index 5a36b733b..9223b445b 100644 --- a/book/cli/reth/stage/dump/storage-hashing.md +++ b/book/cli/reth/stage/dump/storage-hashing.md @@ -47,7 +47,7 @@ Logging: --log.stdout.filter The filter to use for logs written to stdout - [default: info] + [default: ] --log.file.format The format to use for logs written to the log file diff --git a/book/cli/reth/stage/run.md b/book/cli/reth/stage/run.md index a4a6dd59c..c27b0f457 100644 --- a/book/cli/reth/stage/run.md +++ b/book/cli/reth/stage/run.md @@ -185,7 +185,7 @@ Logging: --log.stdout.filter The filter to use for logs written to stdout - [default: info] + [default: ] --log.file.format The format to use for logs written to the log file diff --git a/book/cli/reth/stage/unwind.md b/book/cli/reth/stage/unwind.md index af06b85d0..712b78cf2 100644 --- a/book/cli/reth/stage/unwind.md +++ b/book/cli/reth/stage/unwind.md @@ -74,7 +74,7 @@ Logging: --log.stdout.filter The filter to use for logs written to stdout - [default: info] + [default: ] --log.file.format The format to use for logs written to the log file diff --git a/book/cli/reth/stage/unwind/num-blocks.md b/book/cli/reth/stage/unwind/num-blocks.md index 6daecb5e0..9737bd4fa 100644 --- a/book/cli/reth/stage/unwind/num-blocks.md +++ b/book/cli/reth/stage/unwind/num-blocks.md @@ -59,7 +59,7 @@ Logging: --log.stdout.filter The filter to use for logs written to stdout - [default: info] + [default: ] --log.file.format The format to use for logs written to the log file diff --git a/book/cli/reth/stage/unwind/to-block.md b/book/cli/reth/stage/unwind/to-block.md index bee3b555a..74f8ec4b7 100644 --- a/book/cli/reth/stage/unwind/to-block.md +++ b/book/cli/reth/stage/unwind/to-block.md @@ -59,7 +59,7 @@ Logging: --log.stdout.filter The filter to use for logs written to stdout - [default: info] + [default: ] --log.file.format The format to use for logs written to the log file diff --git a/book/cli/reth/test-vectors.md b/book/cli/reth/test-vectors.md index 061e6ee84..dac4f63cf 100644 --- a/book/cli/reth/test-vectors.md +++ b/book/cli/reth/test-vectors.md @@ -48,7 +48,7 @@ Logging: --log.stdout.filter The filter to use for logs written to stdout - [default: info] + [default: ] --log.file.format The format to use for logs written to the log file diff --git a/book/cli/reth/test-vectors/tables.md b/book/cli/reth/test-vectors/tables.md index f752e8e23..b011881e4 100644 --- a/book/cli/reth/test-vectors/tables.md +++ b/book/cli/reth/test-vectors/tables.md @@ -48,7 +48,7 @@ Logging: --log.stdout.filter The filter to use for logs written to stdout - [default: info] + [default: ] --log.file.format The format to use for logs written to the log file diff --git a/crates/consensus/common/src/validation.rs b/crates/consensus/common/src/validation.rs index 2db00a5bb..a2776b962 100644 --- a/crates/consensus/common/src/validation.rs +++ b/crates/consensus/common/src/validation.rs @@ -220,7 +220,7 @@ pub fn validate_block_standalone( // Check transaction root if let Err(error) = block.ensure_transaction_root_valid() { - return Err(ConsensusError::BodyTransactionRootDiff(error.into())); + return Err(ConsensusError::BodyTransactionRootDiff(error.into())) } // EIP-4895: Beacon chain push withdrawals as operations @@ -280,7 +280,7 @@ fn check_gas_limit( return Err(ConsensusError::GasLimitInvalidIncrease { parent_gas_limit, child_gas_limit: child.gas_limit, - }); + }) } } // Check for a decrease in gas limit beyond the allowed threshold. @@ -288,11 +288,11 @@ fn check_gas_limit( return Err(ConsensusError::GasLimitInvalidDecrease { parent_gas_limit, child_gas_limit: child.gas_limit, - }); + }) } // Check if the child gas limit is below the minimum required limit. else if child.gas_limit < MINIMUM_GAS_LIMIT { - return Err(ConsensusError::GasLimitInvalidMinimum { child_gas_limit: child.gas_limit }); + return Err(ConsensusError::GasLimitInvalidMinimum { child_gas_limit: child.gas_limit }) } Ok(()) diff --git a/crates/ethereum-forks/src/hardfork.rs b/crates/ethereum-forks/src/hardfork.rs index 8608ed050..35b8d5540 100644 --- a/crates/ethereum-forks/src/hardfork.rs +++ b/crates/ethereum-forks/src/hardfork.rs @@ -67,7 +67,7 @@ impl Hardfork { /// Retrieves the activation block for the specified hardfork on the Ethereum mainnet. pub fn mainnet_activation_block(&self, chain: Chain) -> Option { if chain != Chain::mainnet() { - return None; + return None } match self { Hardfork::Frontier => Some(0), @@ -122,7 +122,7 @@ impl Hardfork { /// Retrieves the activation timestamp for the specified hardfork on the given chain. pub fn activation_timestamp(&self, chain: Chain) -> Option { if chain != Chain::mainnet() { - return None; + return None } self.mainnet_activation_timestamp() } diff --git a/crates/net/network/src/transactions/fetcher.rs b/crates/net/network/src/transactions/fetcher.rs index c697fe7d4..0fe0c0ea8 100644 --- a/crates/net/network/src/transactions/fetcher.rs +++ b/crates/net/network/src/transactions/fetcher.rs @@ -282,7 +282,7 @@ impl TransactionFetcher { ); max_retried_and_evicted_hashes.push(hash); - continue; + continue } *retries += 1; } diff --git a/crates/node-core/src/args/log_args.rs b/crates/node-core/src/args/log_args.rs index 6584acc07..49435bded 100644 --- a/crates/node-core/src/args/log_args.rs +++ b/crates/node-core/src/args/log_args.rs @@ -20,12 +20,7 @@ pub struct LogArgs { pub log_stdout_format: LogFormat, /// The filter to use for logs written to stdout. - #[arg( - long = "log.stdout.filter", - value_name = "FILTER", - global = true, - default_value = "info" - )] + #[arg(long = "log.stdout.filter", value_name = "FILTER", global = true, default_value = "")] pub log_stdout_filter: String, /// The format to use for logs written to the log file. @@ -81,8 +76,8 @@ impl LogArgs { fn layer(&self, format: LogFormat, filter: String, use_color: bool) -> LayerInfo { LayerInfo::new( format, + self.verbosity.directive().to_string(), filter, - self.verbosity.directive(), if use_color { Some(self.color.to_string()) } else { None }, ) } diff --git a/crates/storage/libmdbx-rs/src/error.rs b/crates/storage/libmdbx-rs/src/error.rs index e930592a4..aff584619 100644 --- a/crates/storage/libmdbx-rs/src/error.rs +++ b/crates/storage/libmdbx-rs/src/error.rs @@ -227,7 +227,7 @@ pub(crate) fn mdbx_result_with_tx_kind( err_code == ffi::MDBX_EBADSIGN && txn_manager.remove_aborted_read_transaction(txn).is_some() { - return Err(Error::ReadTransactionAborted); + return Err(Error::ReadTransactionAborted) } mdbx_result(err_code) diff --git a/crates/tracing/src/layers.rs b/crates/tracing/src/layers.rs index bcaef6408..35222477f 100644 --- a/crates/tracing/src/layers.rs +++ b/crates/tracing/src/layers.rs @@ -71,11 +71,11 @@ impl Layers { pub(crate) fn stdout( &mut self, format: LogFormat, - directive: Directive, - filter: &str, + default_directive: Directive, + filters: &str, color: Option, ) -> eyre::Result<()> { - let filter = build_env_filter(Some(directive), filter)?; + let filter = build_env_filter(Some(default_directive), filters)?; let layer = format.apply(filter, color, None); self.inner.push(layer.boxed()); Ok(()) @@ -173,7 +173,7 @@ fn build_env_filter( DEFAULT_ENV_FILTER_DIRECTIVES .into_iter() - .chain(directives.split(',')) + .chain(directives.split(',').filter(|d| !d.is_empty())) .try_fold(env_filter, |env_filter, directive| { Ok(env_filter.add_directive(directive.parse()?)) }) diff --git a/crates/tracing/src/lib.rs b/crates/tracing/src/lib.rs index 4617445e2..b469e0ba8 100644 --- a/crates/tracing/src/lib.rs +++ b/crates/tracing/src/lib.rs @@ -19,8 +19,8 @@ //! fn main() -> eyre::Result<()> { //! let tracer = RethTracer::new().with_stdout(LayerInfo::new( //! LogFormat::Json, +//! LevelFilter::INFO.to_string(), //! "debug".to_string(), -//! LevelFilter::INFO.into(), //! None, //! )); //! @@ -42,8 +42,6 @@ )] #![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))] -use tracing_subscriber::filter::Directive; - // Re-export tracing crates pub use tracing; pub use tracing_subscriber; @@ -125,8 +123,8 @@ impl Default for RethTracer { #[derive(Debug, Clone)] pub struct LayerInfo { format: LogFormat, + default_directive: String, filters: String, - directive: Directive, color: Option, } @@ -138,16 +136,16 @@ impl LayerInfo { /// - `LogFormat::Json` for JSON formatting. /// - `LogFormat::LogFmt` for logfmt (key=value) formatting. /// - `LogFormat::Terminal` for human-readable, terminal-friendly formatting. + /// * `default_directive` - Directive for filtering log messages. /// * `filters` - Additional filtering parameters as a string. - /// * `directive` - Directive for filtering log messages. /// * `color` - Optional color configuration for the log messages. pub fn new( format: LogFormat, + default_directive: String, filters: String, - directive: Directive, color: Option, ) -> Self { - Self { format, directive, filters, color } + Self { format, default_directive, filters, color } } } @@ -159,8 +157,8 @@ impl Default for LayerInfo { fn default() -> Self { Self { format: LogFormat::Terminal, - directive: LevelFilter::INFO.into(), - filters: "debug".to_string(), + default_directive: LevelFilter::INFO.to_string(), + filters: "".to_string(), color: Some("always".to_string()), } } @@ -196,7 +194,7 @@ impl Tracer for RethTracer { layers.stdout( self.stdout.format, - self.stdout.directive, + self.stdout.default_directive.parse()?, &self.stdout.filters, self.stdout.color, )?; diff --git a/crates/transaction-pool/src/lib.rs b/crates/transaction-pool/src/lib.rs index 26b7caf84..fec71545d 100644 --- a/crates/transaction-pool/src/lib.rs +++ b/crates/transaction-pool/src/lib.rs @@ -354,7 +354,7 @@ where transactions: Vec, ) -> Vec> { if transactions.is_empty() { - return Vec::new(); + return Vec::new() } let validated = self.validate_all(origin, transactions).await; diff --git a/crates/transaction-pool/src/pool/best.rs b/crates/transaction-pool/src/pool/best.rs index a140b82fd..4e874f5c7 100644 --- a/crates/transaction-pool/src/pool/best.rs +++ b/crates/transaction-pool/src/pool/best.rs @@ -220,7 +220,7 @@ where loop { let best = self.best.next()?; if (self.predicate)(&best) { - return Some(best); + return Some(best) } else { self.best.mark_invalid(&best); } diff --git a/crates/transaction-pool/src/test_utils/mock.rs b/crates/transaction-pool/src/test_utils/mock.rs index abce4b774..09e834fed 100644 --- a/crates/transaction-pool/src/test_utils/mock.rs +++ b/crates/transaction-pool/src/test_utils/mock.rs @@ -732,7 +732,7 @@ impl PoolTransaction for MockTransaction { // If the maximum fee per gas is less than the base fee, return None if max_fee_per_gas < base_fee { - return None; + return None } // Calculate the fee by subtracting the base fee from the maximum fee per gas @@ -741,7 +741,7 @@ impl PoolTransaction for MockTransaction { // If the maximum priority fee per gas is available, return the minimum of fee and priority // fee if let Some(priority_fee) = self.max_priority_fee_per_gas() { - return Some(fee.min(priority_fee)); + return Some(fee.min(priority_fee)) } // Otherwise, return the calculated fee diff --git a/examples/polygon-p2p/src/main.rs b/examples/polygon-p2p/src/main.rs index 3516973c4..ce652f30a 100644 --- a/examples/polygon-p2p/src/main.rs +++ b/examples/polygon-p2p/src/main.rs @@ -34,8 +34,8 @@ async fn main() { let _ = RethTracer::new() .with_stdout(LayerInfo::new( LogFormat::Terminal, - "info".to_string(), - LevelFilter::INFO.into(), + LevelFilter::INFO.to_string(), + "".to_string(), Some("always".to_string()), )) .init();