From 077f0cd0b41ad33ceca9e3e38d24f38926450eb5 Mon Sep 17 00:00:00 2001 From: Doron Zavelevsky Date: Mon, 27 May 2024 20:48:26 +0100 Subject: [PATCH] in Sei use o as max_priority_fee --- fastlane_bot/config/network.py | 7 +++++-- fastlane_bot/helpers/txhelpers.py | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/fastlane_bot/config/network.py b/fastlane_bot/config/network.py index f893d4380..57b37f040 100644 --- a/fastlane_bot/config/network.py +++ b/fastlane_bot/config/network.py @@ -285,9 +285,12 @@ class ConfigNetwork(ConfigBase): # HOOKS ####################################################################################### @staticmethod - def gas_strategy(web3): + def gas_strategy(web3, max_priority_fee_supported=True): gas_price = web3.eth.gas_price # send `eth_gasPrice` request - max_priority_fee = web3.eth.max_priority_fee # send `eth_maxPriorityFeePerGas` request + max_priority_fee = 0 + if max_priority_fee_supported: + max_priority_fee = web3.eth.max_priority_fee # send `eth_maxPriorityFeePerGas` request + return { "maxFeePerGas": gas_price + max_priority_fee, "maxPriorityFeePerGas": max_priority_fee diff --git a/fastlane_bot/helpers/txhelpers.py b/fastlane_bot/helpers/txhelpers.py index 0fdf166fc..d7a557b6a 100644 --- a/fastlane_bot/helpers/txhelpers.py +++ b/fastlane_bot/helpers/txhelpers.py @@ -174,7 +174,7 @@ def _update_transaction(self, tx: dict): if tx["gas"] > result["gasUsed"] and "error" not in result: tx["gas"] = result["gasUsed"] tx["accessList"] = loads(self.cfg.w3.to_json(result["accessList"])) - tx.update(self.cfg.network.gas_strategy(self.cfg.w3)) + tx.update(self.cfg.network.gas_strategy(self.cfg.w3, self.cfg.network == self.cfg.NETWORK_SEI)) def _sign_transaction(self, tx: dict) -> str: return self.cfg.w3.eth.account.sign_transaction(tx, self.cfg.ETH_PRIVATE_KEY_BE_CAREFUL).rawTransaction.hex()