From 9f3e4be896a08183059aee7a82bc38b5b4905ff6 Mon Sep 17 00:00:00 2001 From: greged93 <82421016+greged93@users.noreply.github.com> Date: Thu, 3 Oct 2024 14:12:03 +0200 Subject: [PATCH] fix: relayer balance (#1424) modify the relayer balance threshold for transaction propagation --- src/pool/constants.rs | 1 + src/pool/mempool.rs | 3 ++- src/pool/mod.rs | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 src/pool/constants.rs diff --git a/src/pool/constants.rs b/src/pool/constants.rs new file mode 100644 index 000000000..752ce8384 --- /dev/null +++ b/src/pool/constants.rs @@ -0,0 +1 @@ +pub(super) static ONE_TENTH_ETH: u64 = 10u64.pow(17); diff --git a/src/pool/mempool.rs b/src/pool/mempool.rs index 3974fc2f8..fb4a643cb 100644 --- a/src/pool/mempool.rs +++ b/src/pool/mempool.rs @@ -4,6 +4,7 @@ use super::validate::KakarotTransactionValidator; use crate::{ client::EthClient, into_via_try_wrapper, + pool::constants::ONE_TENTH_ETH, providers::eth_provider::{ constant::RPC_CONFIG, database::state::EthDatabase, starknet::relayer::LockedRelayer, BlockProvider, }, @@ -154,7 +155,7 @@ impl AccountM .unwrap_or_default(); // If the balance is lower than the threshold, continue - if balance < U256::from(u128::pow(10, 18)) { + if balance < U256::from(ONE_TENTH_ETH) { accounts.remove(account_address); continue; } diff --git a/src/pool/mod.rs b/src/pool/mod.rs index 6353b6168..252056409 100644 --- a/src/pool/mod.rs +++ b/src/pool/mod.rs @@ -1,2 +1,3 @@ +mod constants; pub mod mempool; pub mod validate;