Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion oracle/keeper/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand All @@ -234,14 +239,15 @@ 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
if e.args and isinstance(e.args[0], dict):
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:
Expand Down
5 changes: 5 additions & 0 deletions oracle/networks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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"),
),
}
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -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 <tsumak.dmitri@gmail.com>"]
license = "AGPL-3.0-only"
Expand Down
Loading