Skip to content

Commit bec2943

Browse files
authored
Set minimal priority fee for gnosis (#169)
Signed-off-by: cyc60 <[email protected]>
1 parent 49950d3 commit bec2943

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

oracle/keeper/utils.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,11 @@ def _calc_high_priority_fee(web3_client) -> Wei:
219219
if mean_reward > Web3.toWei(1, "gwei"):
220220
mean_reward = round(mean_reward, -8)
221221

222+
min_effective_priority_fee_per_gas = NETWORK_CONFIG[
223+
"MIN_EFFECTIVE_PRIORITY_FEE_PER_GAS"
224+
]
225+
if min_effective_priority_fee_per_gas:
226+
return Wei(max(min_effective_priority_fee_per_gas, mean_reward))
222227
return Wei(mean_reward)
223228

224229

@@ -234,14 +239,15 @@ def submit_update(web3_client: Web3, function_call: ContractFunction) -> None:
234239

235240
# execute transaction
236241
tx_hash = function_call.transact(tx_params)
242+
break
237243
except ValueError as e:
238244
# Handle only FeeTooLow error
239245
code = None
240246
if e.args and isinstance(e.args[0], dict):
241247
code = e.args[0].get("code")
242248
if not code or code != -32010:
243249
raise e
244-
logger.exception(e)
250+
logger.warning(e)
245251
if i < ATTEMPTS_WITH_DEFAULT_GAS - 1: # skip last sleep
246252
time.sleep(NETWORK_CONFIG["SECONDS_PER_BLOCK"])
247253
else:

oracle/networks.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@
7676
IS_POA=False,
7777
DEPOSIT_TOKEN_SYMBOL="ETH",
7878
SECONDS_PER_BLOCK=12,
79+
MIN_EFFECTIVE_PRIORITY_FEE_PER_GAS=Web3.toWei(0, "gwei"),
7980
),
8081
HARBOUR_MAINNET: dict(
8182
STAKEWISE_SUBGRAPH_URLS=config(
@@ -137,6 +138,7 @@
137138
IS_POA=False,
138139
DEPOSIT_TOKEN_SYMBOL="ETH",
139140
SECONDS_PER_BLOCK=12,
141+
MIN_EFFECTIVE_PRIORITY_FEE_PER_GAS=Web3.toWei(0, "gwei"),
140142
),
141143
GOERLI: dict(
142144
STAKEWISE_SUBGRAPH_URLS=config(
@@ -195,6 +197,7 @@
195197
IS_POA=True,
196198
DEPOSIT_TOKEN_SYMBOL="ETH",
197199
SECONDS_PER_BLOCK=12,
200+
MIN_EFFECTIVE_PRIORITY_FEE_PER_GAS=Web3.toWei(0, "gwei"),
198201
),
199202
HARBOUR_GOERLI: dict(
200203
STAKEWISE_SUBGRAPH_URLS=config(
@@ -256,6 +259,7 @@
256259
IS_POA=True,
257260
DEPOSIT_TOKEN_SYMBOL="ETH",
258261
SECONDS_PER_BLOCK=12,
262+
MIN_EFFECTIVE_PRIORITY_FEE_PER_GAS=Web3.toWei(0, "gwei"),
259263
),
260264
GNOSIS_CHAIN: dict(
261265
STAKEWISE_SUBGRAPH_URLS=config(
@@ -316,5 +320,6 @@
316320
IS_POA=True,
317321
DEPOSIT_TOKEN_SYMBOL="GNO",
318322
SECONDS_PER_BLOCK=5,
323+
MIN_EFFECTIVE_PRIORITY_FEE_PER_GAS=Web3.toWei(1, "gwei"),
319324
),
320325
}

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "oracle"
3-
version = "3.5.1"
3+
version = "3.5.2"
44
description = "StakeWise Oracles are responsible for submitting off-chain data."
55
authors = ["Dmitri Tsumak <[email protected]>"]
66
license = "AGPL-3.0-only"

0 commit comments

Comments
 (0)