From 1393e82fa922e6a417417dd67ac7c6e773f43ee2 Mon Sep 17 00:00:00 2001 From: dandanlen <3168260+dandanlen@users.noreply.github.com> Date: Mon, 9 Oct 2023 15:55:32 +0200 Subject: [PATCH] fix: use percentage for eth fee history (#4071) --- engine/src/eth/rpc.rs | 2 +- engine/src/witness/eth/eth_chain_tracking.rs | 8 ++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/engine/src/eth/rpc.rs b/engine/src/eth/rpc.rs index 3329aca7c1..25c9d412e0 100644 --- a/engine/src/eth/rpc.rs +++ b/engine/src/eth/rpc.rs @@ -272,7 +272,7 @@ mod tests { println!("{:?}", block_with_txs); let fee_history = client - .fee_history(10.into(), BlockNumber::Latest, &[0.1, 0.5, 0.9]) + .fee_history(10.into(), BlockNumber::Latest, &[10.0, 50.0, 90.0]) .await .unwrap(); println!("{:?}", fee_history); diff --git a/engine/src/witness/eth/eth_chain_tracking.rs b/engine/src/witness/eth/eth_chain_tracking.rs index 47417fe6b5..79b8b1a1b9 100644 --- a/engine/src/witness/eth/eth_chain_tracking.rs +++ b/engine/src/witness/eth/eth_chain_tracking.rs @@ -15,13 +15,9 @@ impl GetTrackedData::ChainBlockNumber, H256, Bloom>, ) -> Result<::TrackedData, anyhow::Error> { - let priority_fee_percentile = 50u8; + const PRIORITY_FEE_PERCENTILE: f64 = 50.0; let fee_history = self - .fee_history( - U256::one(), - header.index.into(), - vec![priority_fee_percentile as f64 / 100_f64], - ) + .fee_history(U256::one(), header.index.into(), vec![PRIORITY_FEE_PERCENTILE]) .await; Ok(EthereumTrackedData {