chore(primitives): use alloy eth conversion constants (#11892)

This commit is contained in:
Thomas Coratger
2024-10-22 12:34:53 +02:00
committed by GitHub
parent 2973f0c3e8
commit e52f647644
12 changed files with 50 additions and 51 deletions

View File

@ -25,6 +25,7 @@ reth-primitives-traits.workspace = true
# ethereum
alloy-primitives.workspace = true
alloy-rpc-types-engine.workspace = true
alloy-consensus.workspace = true
# async
tokio.workspace = true

View File

@ -1,6 +1,7 @@
//! Support for handling events emitted by node components.
use crate::cl::ConsensusLayerHealthEvent;
use alloy_consensus::constants::GWEI_TO_WEI;
use alloy_primitives::{BlockNumber, B256};
use alloy_rpc_types_engine::ForkchoiceState;
use futures::Stream;
@ -263,7 +264,7 @@ impl NodeState {
gas=%format_gas(block.header.gas_used),
gas_throughput=%format_gas_throughput(block.header.gas_used, elapsed),
full=%format!("{:.1}%", block.header.gas_used as f64 * 100.0 / block.header.gas_limit as f64),
base_fee=%format!("{:.2}gwei", block.header.base_fee_per_gas.unwrap_or(0) as f64 / constants::GWEI_TO_WEI as f64),
base_fee=%format!("{:.2}gwei", block.header.base_fee_per_gas.unwrap_or(0) as f64 / GWEI_TO_WEI as f64),
blobs=block.header.blob_gas_used.unwrap_or(0) / constants::eip4844::DATA_GAS_PER_BLOB,
excess_blobs=block.header.excess_blob_gas.unwrap_or(0) / constants::eip4844::DATA_GAS_PER_BLOB,
?elapsed,