Skip to content

Commit

Permalink
fix: use percentage for eth fee history (#4071)
Browse files Browse the repository at this point in the history
  • Loading branch information
dandanlen authored Oct 9, 2023
1 parent a8353ff commit 1393e82
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion engine/src/eth/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
8 changes: 2 additions & 6 deletions engine/src/witness/eth/eth_chain_tracking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,9 @@ impl<T: EthersRetryRpcApi + Send + Sync + Clone> GetTrackedData<cf_chains::Ether
&self,
header: &Header<<cf_chains::Ethereum as cf_chains::Chain>::ChainBlockNumber, H256, Bloom>,
) -> Result<<cf_chains::Ethereum as cf_chains::Chain>::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 {
Expand Down

0 comments on commit 1393e82

Please sign in to comment.