diff --git a/oracle/keeper/utils.py b/oracle/keeper/utils.py index 93af359..3a4c749 100644 --- a/oracle/keeper/utils.py +++ b/oracle/keeper/utils.py @@ -219,6 +219,11 @@ def _calc_high_priority_fee(web3_client) -> Wei: if mean_reward > Web3.toWei(1, "gwei"): mean_reward = round(mean_reward, -8) + min_effective_priority_fee_per_gas = NETWORK_CONFIG[ + "MIN_EFFECTIVE_PRIORITY_FEE_PER_GAS" + ] + if min_effective_priority_fee_per_gas: + return Wei(max(min_effective_priority_fee_per_gas, mean_reward)) return Wei(mean_reward) @@ -234,6 +239,7 @@ def submit_update(web3_client: Web3, function_call: ContractFunction) -> None: # execute transaction tx_hash = function_call.transact(tx_params) + break except ValueError as e: # Handle only FeeTooLow error code = None @@ -241,7 +247,7 @@ def submit_update(web3_client: Web3, function_call: ContractFunction) -> None: code = e.args[0].get("code") if not code or code != -32010: raise e - logger.exception(e) + logger.warning(e) if i < ATTEMPTS_WITH_DEFAULT_GAS - 1: # skip last sleep time.sleep(NETWORK_CONFIG["SECONDS_PER_BLOCK"]) else: diff --git a/oracle/networks.py b/oracle/networks.py index 041478c..491312a 100644 --- a/oracle/networks.py +++ b/oracle/networks.py @@ -76,6 +76,7 @@ IS_POA=False, DEPOSIT_TOKEN_SYMBOL="ETH", SECONDS_PER_BLOCK=12, + MIN_EFFECTIVE_PRIORITY_FEE_PER_GAS=Web3.toWei(0, "gwei"), ), HARBOUR_MAINNET: dict( STAKEWISE_SUBGRAPH_URLS=config( @@ -137,6 +138,7 @@ IS_POA=False, DEPOSIT_TOKEN_SYMBOL="ETH", SECONDS_PER_BLOCK=12, + MIN_EFFECTIVE_PRIORITY_FEE_PER_GAS=Web3.toWei(0, "gwei"), ), GOERLI: dict( STAKEWISE_SUBGRAPH_URLS=config( @@ -195,6 +197,7 @@ IS_POA=True, DEPOSIT_TOKEN_SYMBOL="ETH", SECONDS_PER_BLOCK=12, + MIN_EFFECTIVE_PRIORITY_FEE_PER_GAS=Web3.toWei(0, "gwei"), ), HARBOUR_GOERLI: dict( STAKEWISE_SUBGRAPH_URLS=config( @@ -256,6 +259,7 @@ IS_POA=True, DEPOSIT_TOKEN_SYMBOL="ETH", SECONDS_PER_BLOCK=12, + MIN_EFFECTIVE_PRIORITY_FEE_PER_GAS=Web3.toWei(0, "gwei"), ), GNOSIS_CHAIN: dict( STAKEWISE_SUBGRAPH_URLS=config( @@ -316,5 +320,6 @@ IS_POA=True, DEPOSIT_TOKEN_SYMBOL="GNO", SECONDS_PER_BLOCK=5, + MIN_EFFECTIVE_PRIORITY_FEE_PER_GAS=Web3.toWei(1, "gwei"), ), } diff --git a/pyproject.toml b/pyproject.toml index f34452d..661168d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "oracle" -version = "3.5.1" +version = "3.5.2" description = "StakeWise Oracles are responsible for submitting off-chain data." authors = ["Dmitri Tsumak "] license = "AGPL-3.0-only"