File tree Expand file tree Collapse file tree 3 files changed +10
-0
lines changed Expand file tree Collapse file tree 3 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -92,6 +92,9 @@ pub struct BlockchainState {
9292 /// The BlockStatus of the block that is considered to be confirmed on the blockchain.
9393 /// For eg., Finalized, Safe
9494 pub confirmed_block_status : BlockStatus ,
95+
96+ /// The maximum percentage that the gas limit can be multiplied by during backoff retries
97+ pub backoff_gas_multiplier_cap_pct : u64 ,
9598}
9699
97100pub enum RestError {
@@ -212,6 +215,7 @@ mod test {
212215 provider_address : PROVIDER ,
213216 reveal_delay_blocks : 1 ,
214217 confirmed_block_status : BlockStatus :: Latest ,
218+ backoff_gas_multiplier_cap_pct : 500 ,
215219 } ;
216220
217221 let metrics_registry = Arc :: new ( RwLock :: new ( Registry :: default ( ) ) ) ;
@@ -225,6 +229,7 @@ mod test {
225229 provider_address : PROVIDER ,
226230 reveal_delay_blocks : 2 ,
227231 confirmed_block_status : BlockStatus :: Latest ,
232+ backoff_gas_multiplier_cap_pct : 500 ,
228233 } ;
229234
230235 let mut chains = HashMap :: new ( ) ;
Original file line number Diff line number Diff line change @@ -296,6 +296,7 @@ async fn setup_chain_state(
296296 provider_address : * provider,
297297 reveal_delay_blocks : chain_config. reveal_delay_blocks ,
298298 confirmed_block_status : chain_config. confirmed_block_status ,
299+ backoff_gas_multiplier_cap_pct : chain_config. backoff_gas_multiplier_cap_pct ,
299300 } ;
300301 Ok ( state)
301302}
Original file line number Diff line number Diff line change @@ -248,6 +248,10 @@ pub async fn run_keeper_threads(
248248 let latest_safe_block = get_latest_safe_block ( & chain_state) . in_current_span ( ) . await ;
249249 tracing:: info!( "latest safe block: {}" , & latest_safe_block) ;
250250
251+ // Update BlockchainState with the gas multiplier cap from config
252+ let mut chain_state = chain_state;
253+ chain_state. backoff_gas_multiplier_cap_pct = chain_eth_config. backoff_gas_multiplier_cap_pct ;
254+
251255 let contract = Arc :: new (
252256 InstrumentedSignablePythContract :: from_config (
253257 & chain_eth_config,
You can’t perform that action at this time.
0 commit comments