diff --git a/script/src/lib.rs b/script/src/lib.rs index 27408d7..3312785 100644 --- a/script/src/lib.rs +++ b/script/src/lib.rs @@ -14,7 +14,6 @@ use helios_ethereum::{ use std::sync::Arc; use tokio::sync::{mpsc::channel, watch}; use tree_hash::TreeHash; -pub mod relay; pub const MAX_REQUEST_LIGHT_CLIENT_UPDATES: u8 = 128; diff --git a/script/src/relay.rs b/script/src/relay.rs deleted file mode 100644 index b678b09..0000000 --- a/script/src/relay.rs +++ /dev/null @@ -1,30 +0,0 @@ -use alloy::providers::{Provider, RootProvider}; -use alloy::transports::http::{Client, Http}; - -/// Get the gas limit associated with the chain id. Note: These values have been found through -/// trial and error and can be configured. -pub fn get_gas_limit(chain_id: u64) -> u128 { - if chain_id == 42161 || chain_id == 421614 { - 25_000_000 - } else { - 1_500_000 - } -} - -/// Get the gas fee cap associated with the chain id, using the provider to get the gas price. Note: -/// These values have been found through trial and error and can be configured. -pub async fn get_fee_cap(chain_id: u64, provider: &RootProvider>) -> u128 { - // Base percentage multiplier for the gas fee. - let mut multiplier = 20; - - // Double the estimated gas fee cap for the testnets. - if chain_id == 17000 || chain_id == 421614 || chain_id == 11155111 || chain_id == 84532 { - multiplier = 100 - } - - // Get the gas price. - let gas_price = provider.get_gas_price().await.unwrap(); - - // Calculate the fee cap. - (gas_price * (100 + multiplier)) / 100 -}