Skip to content

Commit 316ca81

Browse files
authored
Merge pull request #782 from valory-xyz/fix/gas-estimation
Accounts for the minimum allowed tip on chains
2 parents 3f1df8d + 3a170ad commit 316ca81

File tree

32 files changed

+134
-80
lines changed

32 files changed

+134
-80
lines changed

.spelling

+1
Original file line numberDiff line numberDiff line change
@@ -387,3 +387,4 @@ deserialisation
387387
solana
388388
1.48.0.post1
389389
macOS
390+
tasks.py

HISTORY.md

+8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Release History - open AEA
22

3+
## 1.62.0 (2025-01-29)
4+
5+
Packages:
6+
- Updates tasks.py log level to debug #774
7+
8+
Plugins:
9+
- Accounts for the minimum allowed tip on chains #782
10+
311
## 1.61.0 (2025-01-24)
412

513
AEA:

aea/__version__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
__title__ = "open-aea"
2424
__description__ = "Open Autonomous Economic Agent framework (without vendor lock-in)"
2525
__url__ = "https://github.com/valory-xyz/open-aea.git"
26-
__version__ = "1.61.0"
26+
__version__ = "1.62.0"
2727
__author__ = "Valory AG"
2828
__license__ = "Apache-2.0"
2929
__copyright__ = "2021 Valory AG, 2019 Fetch.AI Limited"

deploy-image/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ RUN apk add --no-cache go
1616

1717
# aea installation
1818
RUN pip install --upgrade pip
19-
RUN pip install --upgrade --force-reinstall open-aea[all]==1.61.0 "open-aea-cli-ipfs<2.0.0,>=1.61.0"
19+
RUN pip install --upgrade --force-reinstall open-aea[all]==1.62.0 "open-aea-cli-ipfs<2.0.0,>=1.62.0"
2020

2121
# directories and aea cli config
2222
WORKDIR /home/agents

deploy-image/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ The example uses the `fetchai/my_first_aea` project. You will likely want to mod
1111
Install subversion, then download the example directory to your local working directory
1212

1313
``` bash
14-
svn checkout https://github.com/valory-xyz/open-aea/tags/v1.61.0/packages packages
14+
svn checkout https://github.com/valory-xyz/open-aea/tags/v1.62.0/packages packages
1515
```
1616

1717
### Modify scripts

develop-image/docker-env.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22

33
# Swap the following lines if you want to work with 'latest'
4-
DOCKER_IMAGE_TAG=valory/open-aea-develop:1.61.0
4+
DOCKER_IMAGE_TAG=valory/open-aea-develop:1.62.0
55
# DOCKER_IMAGE_TAG=valory/open-aea-develop:latest
66

77
DOCKER_BUILD_CONTEXT_DIR=..

docs/api/plugins/aea_ledger_ethereum/ethereum.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ Returns multiplier value.
5353
def estimate_priority_fee(
5454
web3_object: Web3, block_number: int,
5555
default_priority_fee: Optional[int], fee_history_blocks: int,
56-
fee_history_percentile: int,
56+
fee_history_percentile: int, min_allowed_tip: int,
5757
priority_fee_increase_boundary: int) -> Optional[int]
5858
```
5959

@@ -67,7 +67,7 @@ Estimate priority fee from base fee.
6767
def get_gas_price_strategy_eip1559(
6868
max_gas_fast: int, fee_history_blocks: int, fee_history_percentile: int,
6969
default_priority_fee: Optional[int], fallback_estimate: Dict[str, Wei],
70-
priority_fee_increase_boundary: int
70+
min_allowed_tip: int, priority_fee_increase_boundary: int
7171
) -> Callable[[Web3, TxParams], Dict[str, Wei]]
7272
```
7373

docs/package_list.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
| contract/fetchai/erc1155/0.22.0 | `bafybeiff7a6xncyad53o2r7lekpnhexcspze6ocy55xtpzqeuacnlpunm4` |
1515
| connection/fetchai/gym/0.19.0 | `bafybeicpzcp2otfv4p3bvz44n2wurpsqddlwyc6mnuwbhimidjqvttw27y` |
1616
| connection/fetchai/stub/0.21.0 | `bafybeibqrgcch7dufgvzoxi43vxbbhx6isfn3njhq5q3eud6yhhyjdnthm` |
17-
| connection/valory/ledger/0.19.0 | `bafybeib4q36hr3rnfq5geuzkkgih3q5oridjdnewzvajb4lflijdyrn7pq` |
17+
| connection/valory/ledger/0.19.0 | `bafybeibiayfscw4badpr545f47hsvc2r5lgfpgzib5q4h4u6kkosdsytby` |
1818
| connection/valory/http_server/0.22.0 | `bafybeic3jpkum7g6qo6x6vdrmvvhj7vqw7ec2op72uc3yfhmnlp5hn3joy` |
1919
| connection/valory/p2p_libp2p/0.1.0 | `bafybeig2atkjnrz7lsboubaque567ndtzog6k53dnmrrq3eeqgbqmmcq5y` |
2020
| connection/valory/p2p_libp2p_client/0.1.0 | `bafybeic6ayusdwy4dks75njwk32ac7ur7salgllwf4fdc34ue5z2k5iz4q` |
@@ -26,12 +26,12 @@
2626
| skill/fetchai/error_test_skill/0.1.0 | `bafybeihsbtlpe7h6fsvoxban5rilkmwviwkokul5cqym6atoolirontiyu` |
2727
| skill/fetchai/gym/0.20.0 | `bafybeih27hdrpzjz2fp5u2n7mgyrqqk3cyuempiixn6ptkkztvld7d4jhe` |
2828
| skill/fetchai/http_echo/0.20.0 | `bafybeiabpmclv4njsrxfwgsmei5vbcj7bzm53h5dsi5lubiuelboauedwy` |
29-
| skill/fetchai/erc1155_client/0.28.0 | `bafybeiezbjumow3sh324pue5mxafrcj7sea27h6us3tqtt3fydttn6kdvi` |
30-
| skill/fetchai/erc1155_deploy/0.30.0 | `bafybeifjygruiz2zyewa3no24icclxfpc2c2e7gflztyss6ea2jpudmygu` |
29+
| skill/fetchai/erc1155_client/0.28.0 | `bafybeiaxa2jrde46t5dunwu6ndo35aruvk6dufbgocgoqqtsgqi3ouu5e4` |
30+
| skill/fetchai/erc1155_deploy/0.30.0 | `bafybeidltd53r4zcur2ovclaog5tqjqd64fm565s3ak776bnbe5w4ziafq` |
3131
| skill/fetchai/error/0.17.0 | `bafybeib3sed2rk7monjh23gorihtnzpov5yrlqqjvyavnjjtxchz2uxeoy` |
3232
| skill/fetchai/fipa_dummy_buyer/0.2.0 | `bafybeifior4ve3cjsnq6uqi4ipcltkoab47dh2b4evcmwq53kx52fzbqga` |
33-
| skill/fetchai/generic_buyer/0.26.0 | `bafybeiegz6ldnrhky6p5zgxeyae6s2jowbx7dfeldenqy7tiodjqsbljlq` |
34-
| skill/fetchai/generic_seller/0.27.0 | `bafybeidxgdaejcflbgdnfk53hbs2rfkhslo5brz2waynxleuspksuuyozy` |
33+
| skill/fetchai/generic_buyer/0.26.0 | `bafybeiejgrv6fvca2o7ofcnqtohr2vypf2sqdvdow5ydxio6vzbswlsu3m` |
34+
| skill/fetchai/generic_seller/0.27.0 | `bafybeidzard53m5m3ttalg62nz4ejjgutheigp4lomefxtayg37y6oylpa` |
3535
| skill/fetchai/task_test_skill/0.1.0 | `bafybeidv77u2xl52mnxakwvh7fuh46aiwfpteyof4eaptfd4agoi6cdble` |
3636
| agent/fetchai/error_test/0.1.0 | `bafybeifkbnneq3vhxxzl4ajw2l4j4ndrrqpcxih2i6ymrgfqecjitdfx6a` |
3737
| agent/fetchai/gym_aea/0.25.0 | `bafybeig2hwgtvqndklrablhdlo4fhxjh2bhntejcu62pmojcwba5i77aky` |

docs/upgrading.md

+4
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ Below we describe the additional manual steps required to upgrade between differ
99

1010
### Upgrade guide
1111

12+
## `v1.61.0` to `v1.62.0`
13+
14+
- No backwards incompatible changes
15+
1216
## `v1.60.0` to `v1.61.0`
1317

1418
- No backwards incompatible changes

examples/tac_deploy/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ RUN apk add --no-cache go
1919

2020
# aea installation
2121
RUN python -m pip install --upgrade pip
22-
RUN pip install --upgrade --force-reinstall open-aea[all]==1.61.0
22+
RUN pip install --upgrade --force-reinstall open-aea[all]==1.62.0
2323

2424
# directories and aea cli config
2525
COPY /.aea /home/.aea

packages/fetchai/skills/erc1155_client/skill.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ fingerprint:
2121
tests/test_strategy.py: bafybeicbxie3v6vue3gcnru6vsvggcgy3shxwrldis5gppizbuhooslcqa
2222
fingerprint_ignore_patterns: []
2323
connections:
24-
- valory/ledger:0.19.0:bafybeib4q36hr3rnfq5geuzkkgih3q5oridjdnewzvajb4lflijdyrn7pq
24+
- valory/ledger:0.19.0:bafybeibiayfscw4badpr545f47hsvc2r5lgfpgzib5q4h4u6kkosdsytby
2525
contracts:
2626
- fetchai/erc1155:0.22.0:bafybeiff7a6xncyad53o2r7lekpnhexcspze6ocy55xtpzqeuacnlpunm4
2727
protocols:

packages/fetchai/skills/erc1155_deploy/skill.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ fingerprint:
2121
tests/test_strategy.py: bafybeigxtw2j2c7vl6xhdwos62jbtmx62xfgdyadptm5eewmkesmcooyea
2222
fingerprint_ignore_patterns: []
2323
connections:
24-
- valory/ledger:0.19.0:bafybeib4q36hr3rnfq5geuzkkgih3q5oridjdnewzvajb4lflijdyrn7pq
24+
- valory/ledger:0.19.0:bafybeibiayfscw4badpr545f47hsvc2r5lgfpgzib5q4h4u6kkosdsytby
2525
contracts:
2626
- fetchai/erc1155:0.22.0:bafybeiff7a6xncyad53o2r7lekpnhexcspze6ocy55xtpzqeuacnlpunm4
2727
protocols:

packages/fetchai/skills/generic_buyer/skill.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ fingerprint:
1919
tests/test_models.py: bafybeibh72j3n72yseqvmpppucpu5wtidf6ebxbxkfnmrnlh4zv5y5apei
2020
fingerprint_ignore_patterns: []
2121
connections:
22-
- valory/ledger:0.19.0:bafybeib4q36hr3rnfq5geuzkkgih3q5oridjdnewzvajb4lflijdyrn7pq
22+
- valory/ledger:0.19.0:bafybeibiayfscw4badpr545f47hsvc2r5lgfpgzib5q4h4u6kkosdsytby
2323
contracts: []
2424
protocols:
2525
- fetchai/default:1.0.0:bafybeiaf3qhrdttthrisrl2tlpt3mpo5btkozw2dnxlj4cbqq56ilcl6oa

packages/fetchai/skills/generic_seller/skill.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ fingerprint:
2020
tests/test_models.py: bafybeihabrc22zqssit3fmqhxptosy6qz6mx65ukhf5iayvirfv42xrhoq
2121
fingerprint_ignore_patterns: []
2222
connections:
23-
- valory/ledger:0.19.0:bafybeib4q36hr3rnfq5geuzkkgih3q5oridjdnewzvajb4lflijdyrn7pq
23+
- valory/ledger:0.19.0:bafybeibiayfscw4badpr545f47hsvc2r5lgfpgzib5q4h4u6kkosdsytby
2424
contracts: []
2525
protocols:
2626
- fetchai/default:1.0.0:bafybeiaf3qhrdttthrisrl2tlpt3mpo5btkozw2dnxlj4cbqq56ilcl6oa

packages/packages.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"contract/fetchai/erc1155/0.22.0": "bafybeiff7a6xncyad53o2r7lekpnhexcspze6ocy55xtpzqeuacnlpunm4",
1515
"connection/fetchai/gym/0.19.0": "bafybeicpzcp2otfv4p3bvz44n2wurpsqddlwyc6mnuwbhimidjqvttw27y",
1616
"connection/fetchai/stub/0.21.0": "bafybeibqrgcch7dufgvzoxi43vxbbhx6isfn3njhq5q3eud6yhhyjdnthm",
17-
"connection/valory/ledger/0.19.0": "bafybeib4q36hr3rnfq5geuzkkgih3q5oridjdnewzvajb4lflijdyrn7pq",
17+
"connection/valory/ledger/0.19.0": "bafybeibiayfscw4badpr545f47hsvc2r5lgfpgzib5q4h4u6kkosdsytby",
1818
"connection/valory/http_server/0.22.0": "bafybeic3jpkum7g6qo6x6vdrmvvhj7vqw7ec2op72uc3yfhmnlp5hn3joy",
1919
"connection/valory/p2p_libp2p/0.1.0": "bafybeig2atkjnrz7lsboubaque567ndtzog6k53dnmrrq3eeqgbqmmcq5y",
2020
"connection/valory/p2p_libp2p_client/0.1.0": "bafybeic6ayusdwy4dks75njwk32ac7ur7salgllwf4fdc34ue5z2k5iz4q",
@@ -26,12 +26,12 @@
2626
"skill/fetchai/error_test_skill/0.1.0": "bafybeihsbtlpe7h6fsvoxban5rilkmwviwkokul5cqym6atoolirontiyu",
2727
"skill/fetchai/gym/0.20.0": "bafybeih27hdrpzjz2fp5u2n7mgyrqqk3cyuempiixn6ptkkztvld7d4jhe",
2828
"skill/fetchai/http_echo/0.20.0": "bafybeiabpmclv4njsrxfwgsmei5vbcj7bzm53h5dsi5lubiuelboauedwy",
29-
"skill/fetchai/erc1155_client/0.28.0": "bafybeiezbjumow3sh324pue5mxafrcj7sea27h6us3tqtt3fydttn6kdvi",
30-
"skill/fetchai/erc1155_deploy/0.30.0": "bafybeifjygruiz2zyewa3no24icclxfpc2c2e7gflztyss6ea2jpudmygu",
29+
"skill/fetchai/erc1155_client/0.28.0": "bafybeiaxa2jrde46t5dunwu6ndo35aruvk6dufbgocgoqqtsgqi3ouu5e4",
30+
"skill/fetchai/erc1155_deploy/0.30.0": "bafybeidltd53r4zcur2ovclaog5tqjqd64fm565s3ak776bnbe5w4ziafq",
3131
"skill/fetchai/error/0.17.0": "bafybeib3sed2rk7monjh23gorihtnzpov5yrlqqjvyavnjjtxchz2uxeoy",
3232
"skill/fetchai/fipa_dummy_buyer/0.2.0": "bafybeifior4ve3cjsnq6uqi4ipcltkoab47dh2b4evcmwq53kx52fzbqga",
33-
"skill/fetchai/generic_buyer/0.26.0": "bafybeiegz6ldnrhky6p5zgxeyae6s2jowbx7dfeldenqy7tiodjqsbljlq",
34-
"skill/fetchai/generic_seller/0.27.0": "bafybeidxgdaejcflbgdnfk53hbs2rfkhslo5brz2waynxleuspksuuyozy",
33+
"skill/fetchai/generic_buyer/0.26.0": "bafybeiejgrv6fvca2o7ofcnqtohr2vypf2sqdvdow5ydxio6vzbswlsu3m",
34+
"skill/fetchai/generic_seller/0.27.0": "bafybeidzard53m5m3ttalg62nz4ejjgutheigp4lomefxtayg37y6oylpa",
3535
"skill/fetchai/task_test_skill/0.1.0": "bafybeidv77u2xl52mnxakwvh7fuh46aiwfpteyof4eaptfd4agoi6cdble",
3636
"agent/fetchai/error_test/0.1.0": "bafybeifkbnneq3vhxxzl4ajw2l4j4ndrrqpcxih2i6ymrgfqecjitdfx6a",
3737
"agent/fetchai/gym_aea/0.25.0": "bafybeig2hwgtvqndklrablhdlo4fhxjh2bhntejcu62pmojcwba5i77aky",

packages/valory/connections/ledger/connection.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ config:
3737
max_gas_fast: 1500
3838
fee_history_blocks: 10
3939
fee_history_percentile: 5
40+
min_allowed_tip: 1000000000
4041
default_priority_fee: null
4142
fallback_estimate:
4243
maxFeePerGas: 20000000000

plugins/aea-cli-benchmark/setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
setup(
2828
name="open-aea-cli-benchmark",
29-
version="1.61.0",
29+
version="1.62.0",
3030
author="Valory AG",
3131
license="Apache-2.0",
3232
description="CLI extension for AEA framework benchmarking.",

plugins/aea-cli-ipfs/setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929
setup(
3030
name="open-aea-cli-ipfs",
31-
version="1.61.0",
31+
version="1.62.0",
3232
author="Valory AG",
3333
license="Apache-2.0",
3434
description="CLI extension for open AEA framework wrapping IPFS functionality.",

plugins/aea-ledger-cosmos/setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
setup(
2828
name="open-aea-ledger-cosmos",
29-
version="1.61.0",
29+
version="1.62.0",
3030
author="Valory AG",
3131
license="Apache-2.0",
3232
description="Python package wrapping the public and private key cryptography and ledger api of Cosmos.",

plugins/aea-ledger-ethereum-flashbots/setup.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
setup(
2727
name="open-aea-ledger-ethereum-flashbots",
28-
version="1.61.0",
28+
version="1.62.0",
2929
author="Valory AG",
3030
license="Apache-2.0",
3131
description="Python package extending the default open-aea ethereum ledger plugin to add support for flashbots.",
@@ -41,7 +41,7 @@
4141
},
4242
python_requires=">=3.9,<4.0",
4343
install_requires=[
44-
"open-aea-ledger-ethereum~=1.61.0",
44+
"open-aea-ledger-ethereum~=1.62.0",
4545
"open-aea-flashbots==1.4.0",
4646
],
4747
tests_require=["pytest"],

plugins/aea-ledger-ethereum-hwi/setup.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
setup(
2727
name="open-aea-ledger-ethereum-hwi",
28-
version="1.61.0",
28+
version="1.62.0",
2929
author="Valory AG",
3030
license="Apache-2.0",
3131
description="Python package wrapping the public and private key cryptography and support for hardware wallet interactions.",
@@ -42,7 +42,7 @@
4242
"web3>=6.0.0,<7",
4343
"ipfshttpclient==0.8.0a2",
4444
"eth-account>=0.8.0,<0.9.0",
45-
"open-aea-ledger-ethereum~=1.61.0",
45+
"open-aea-ledger-ethereum~=1.62.0",
4646
"ledgerwallet==0.1.3",
4747
"protobuf<4.25.0,>=4.21.6",
4848
"construct<=2.10.61",

plugins/aea-ledger-ethereum/aea_ledger_ethereum/ethereum.py

+27-34
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# -*- coding: utf-8 -*-
22
# ------------------------------------------------------------------------------
33
#
4-
# Copyright 2021-2024 Valory AG
4+
# Copyright 2021-2025 Valory AG
55
# Copyright 2018-2019 Fetch.AI Limited
66
#
77
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -84,8 +84,6 @@
8484
POLYGON_GAS_ENDPOINT = "https://gasstation-mainnet.matic.network/v2"
8585
MAX_GAS_FAST = 1500
8686
RPC_CALL_MAX_WORKERS = 1
87-
N_RETRIES = 3
88-
PERCENTILE_INCREASE = 5
8987

9088
# How many blocks to consider for priority fee estimation
9189
FEE_HISTORY_BLOCKS = 10
@@ -104,12 +102,16 @@
104102

105103
PRIORITY_FEE_INCREASE_BOUNDARY = 200 # percentage
106104

105+
# this is the minimum allowed max fee per gas on Gnosis
106+
DEFAULT_MIN_ALLOWED_TIP = to_wei(1, "gwei")
107+
107108
DEFAULT_EIP1559_STRATEGY = {
108109
"max_gas_fast": MAX_GAS_FAST,
109110
"fee_history_blocks": FEE_HISTORY_BLOCKS,
110111
"fee_history_percentile": FEE_HISTORY_PERCENTILE,
111112
"default_priority_fee": DEFAULT_PRIORITY_FEE,
112113
"fallback_estimate": FALLBACK_ESTIMATE,
114+
"min_allowed_tip": DEFAULT_MIN_ALLOWED_TIP,
113115
"priority_fee_increase_boundary": PRIORITY_FEE_INCREASE_BOUNDARY,
114116
}
115117

@@ -169,32 +171,33 @@ def estimate_priority_fee(
169171
default_priority_fee: Optional[int],
170172
fee_history_blocks: int,
171173
fee_history_percentile: int,
174+
min_allowed_tip: int,
172175
priority_fee_increase_boundary: int,
173176
) -> Optional[int]:
174177
"""Estimate priority fee from base fee."""
175178

176179
if default_priority_fee is not None:
177180
return default_priority_fee
178181

179-
for _ in range(N_RETRIES):
180-
fee_history = web3_object.eth.fee_history(
181-
fee_history_blocks, block_number, [fee_history_percentile] # type: ignore
182-
)
183-
# This is going to break if more percentiles are introduced in the future,
184-
# i.e., `fee_history_percentile` param becomes a `List[int]`.
185-
rewards = sorted(
186-
[reward[0] for reward in fee_history.get("reward", []) if reward[0] > 0]
187-
)
188-
# we need atleast 2 rewards to proceed further
189-
if len(rewards) >= 2:
190-
break
191-
# Increment percentile for next attempt
192-
fee_history_percentile = min(100, fee_history_percentile + PERCENTILE_INCREASE)
193-
194-
# Return None if fewer than 2 rewards after retries
195-
if len(rewards) < 2:
182+
fee_history = web3_object.eth.fee_history(
183+
fee_history_blocks, block_number, [fee_history_percentile] # type: ignore
184+
)
185+
186+
# This is going to break if more percentiles are introduced in the future,
187+
# i.e., `fee_history_percentile` param becomes a `List[int]`.
188+
rewards = sorted(
189+
[
190+
reward[0]
191+
for reward in fee_history.get("reward", [])
192+
if reward[0] >= min_allowed_tip
193+
]
194+
)
195+
if len(rewards) == 0:
196196
return None
197197

198+
if len(rewards) == 1:
199+
return rewards[0]
200+
198201
# Calculate percentage increases from between ordered list of fees
199202
percentage_increases = [
200203
((j - i) / i) * 100 if i != 0 else 0 for i, j in zip(rewards[:-1], rewards[1:])
@@ -220,6 +223,7 @@ def get_gas_price_strategy_eip1559(
220223
fee_history_percentile: int,
221224
default_priority_fee: Optional[int],
222225
fallback_estimate: Dict[str, Wei],
226+
min_allowed_tip: int,
223227
priority_fee_increase_boundary: int,
224228
) -> Callable[[Web3, TxParams], Dict[str, Wei]]:
225229
"""Get the gas price strategy."""
@@ -253,33 +257,22 @@ def eip1559_price_strategy(
253257
if base_fee is None or block_number is None:
254258
return fallback()
255259

256-
base_fee_gwei = to_eth_unit(base_fee)
257-
258260
estimated_priority_fee = estimate_priority_fee(
259261
web3,
260262
block_number,
261263
default_priority_fee=default_priority_fee,
262264
fee_history_blocks=fee_history_blocks,
263265
fee_history_percentile=fee_history_percentile,
266+
min_allowed_tip=min_allowed_tip,
264267
priority_fee_increase_boundary=priority_fee_increase_boundary,
265268
)
266269

267270
if estimated_priority_fee is None:
268271
return fallback()
269272

270-
multiplier = get_base_fee_multiplier(base_fee_gwei)
271-
272-
potential_max_fee = base_fee * multiplier
273-
max_fee_per_gas = (
274-
(potential_max_fee + estimated_priority_fee)
275-
if estimated_priority_fee > potential_max_fee
276-
else potential_max_fee
277-
)
273+
max_fee_per_gas = base_fee + estimated_priority_fee
278274

279-
if (
280-
to_eth_unit(max_fee_per_gas) >= max_gas_fast
281-
or to_eth_unit(estimated_priority_fee) >= max_gas_fast
282-
):
275+
if to_eth_unit(max_fee_per_gas) >= max_gas_fast:
283276
return fallback(
284277
"The estimated gas price is larger than the `max_gas_fast`. Falling back."
285278
)

plugins/aea-ledger-ethereum/setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
setup(
2828
name="open-aea-ledger-ethereum",
29-
version="1.61.0",
29+
version="1.62.0",
3030
author="Valory AG",
3131
license="Apache-2.0",
3232
description="Python package wrapping the public and private key cryptography and ledger api of Ethereum.",

0 commit comments

Comments
 (0)