Prechádzať zdrojové kódy

Use u64 since U256 was not deserialized correctly from config (#1591)

Amin Moghaddam 1 rok pred
rodič
commit
feaa000ca9

+ 1 - 1
apps/fortuna/Cargo.lock

@@ -1488,7 +1488,7 @@ dependencies = [
 
 [[package]]
 name = "fortuna"
-version = "5.3.1"
+version = "5.3.2"
 dependencies = [
  "anyhow",
  "axum",

+ 1 - 1
apps/fortuna/Cargo.toml

@@ -1,6 +1,6 @@
 [package]
 name    = "fortuna"
-version = "5.3.1"
+version = "5.3.2"
 edition = "2021"
 
 [dependencies]

+ 2 - 5
apps/fortuna/src/config.rs

@@ -18,10 +18,7 @@ use {
         Args,
         Parser,
     },
-    ethers::types::{
-        Address,
-        U256,
-    },
+    ethers::types::Address,
     std::{
         collections::HashMap,
         fs,
@@ -161,7 +158,7 @@ pub struct EthereumConfig {
     pub confirmed_block_status: BlockStatus,
 
     /// The gas limit to use for entropy callback transactions.
-    pub gas_limit: U256,
+    pub gas_limit: u64,
 }
 
 #[derive(Args, Clone, Debug)]

+ 3 - 2
apps/fortuna/src/keeper.rs

@@ -228,6 +228,7 @@ pub async fn run_keeper_threads(
     let fulfilled_requests_cache = Arc::new(RwLock::new(HashMap::<u64, RequestState>::new()));
 
     // Spawn a thread to handle the events from last BACKLOG_RANGE blocks.
+    let gas_limit: U256 = chain_eth_config.gas_limit.into();
     spawn(
         process_backlog(
             BlockRange {
@@ -235,7 +236,7 @@ pub async fn run_keeper_threads(
                 to:   latest_safe_block,
             },
             contract.clone(),
-            chain_eth_config.gas_limit,
+            gas_limit,
             chain_state.clone(),
             keeper_metrics.clone(),
             fulfilled_requests_cache.clone(),
@@ -260,7 +261,7 @@ pub async fn run_keeper_threads(
             chain_state.clone(),
             rx,
             Arc::clone(&contract),
-            chain_eth_config.gas_limit,
+            gas_limit,
             keeper_metrics.clone(),
             fulfilled_requests_cache.clone(),
         )