From 1950e3626f59b42315ed5e531c5e42af974a5291 Mon Sep 17 00:00:00 2001 From: Gregory Edison Date: Thu, 3 Oct 2024 13:46:30 +0200 Subject: [PATCH] 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;