Skip to content

Commit 1e81a1f

Browse files
Merge branch 'main' into method-formatters
2 parents 5f99954 + f6f4fd3 commit 1e81a1f

File tree

90 files changed

+1076
-554
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+1076
-554
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ parameters:
44
# NOTE: Do not update the `geth_version` manually. It is updated during the
55
# integration test fixture generation.
66
geth_version:
7-
default: "1.15.5"
7+
default: "1.15.11"
88
type: string
99
go_version:
1010
default: "1.24.1"

docs/contributing.rst

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ Within the ``pytest`` scope, :file:`conftest.py` files are used for common code
160160
shared between modules that exist within the same directory as that particular
161161
:file:`conftest.py` file.
162162

163+
163164
Unit Testing and eth-tester Tests
164165
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
165166

@@ -200,6 +201,16 @@ tests are written across different files within ``/web3/_utils/module_testing``.
200201
client-and-provider-specific test configurations exist. This is mostly used to
201202
override tests specific to the provider type for the respective client.
202203

204+
The integration tests are each run in insolation to prevent muddied contexts. Because
205+
they are run in isolation, they can be parallelized with ``pytest-xdist`` in order to
206+
speed up the test suite. To run the tests in parallel, you can use the ``-n`` flag
207+
with ``pytest``. For example, to run the tests in parallel with 4 workers, you can
208+
use the following command:
209+
210+
.. code:: sh
211+
212+
$ pytest tests/integration/go_ethereum/path/to/module/or/test -n 4
213+
203214
204215
Working With Test Contracts
205216
^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -365,13 +376,13 @@ Geth Fixtures
365376

366377
.. code:: sh
367378
368-
$ python -m geth.install v1.15.5
379+
$ python -m geth.install v1.15.11
369380
370381
2. Specify the Geth binary and run the fixture creation script (from within the web3.py directory):
371382

372383
.. code:: sh
373384
374-
$ GETH_BINARY=~/.py-geth/geth-v1.15.5/bin/geth python ./tests/integration/generate_fixtures/go_ethereum.py
385+
$ GETH_BINARY=~/.py-geth/geth-v1.15.11/bin/geth python ./tests/integration/generate_fixtures/go_ethereum.py
375386
376387
3. The output of this script is your fixture, a zip file, which is now stored in ``/tests/integration/``.
377388
The ``/tests/integration/go_ethereum/conftest.py`` and

docs/ens_overview.rst

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,6 @@ The :mod:`ens` module is included with web3.py. It provides an interface to look
1111
domains and addresses, add resolver records, or get and set metadata.
1212

1313

14-
.. note::
15-
16-
web3.py ``v6.6.0`` introduced ENS name normalization standard
17-
`ENSIP-15 <https://docs.ens.domains/ensip/15>`_.
18-
This update to ENS name validation and normalization won't affect ~99%
19-
of names but may prevent invalid names from being created and from interacting with
20-
the ENS contracts via web3.py. We feel strongly that this change, though breaking,
21-
is in the best interest of our users as it ensures compatibility with the latest ENS
22-
standards.
23-
24-
2514
Setup
2615
-----
2716

docs/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Getting Started
3939
.. include:: toc.rst
4040

4141

42-
.. _decentralized apps (dapps): https://ethereum.org/dapps/
42+
.. _decentralized apps (dapps): https://ethereum.org/en/dapps/
4343
.. _@EthereumPython: https://twitter.com/EthereumPython
4444
.. _blog: https://snakecharmers.ethereum.org/
4545
.. _blog post series: https://snakecharmers.ethereum.org/a-developers-guide-to-ethereum-pt-1

docs/release_notes.rst

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,43 @@ v7 Breaking Changes Summary
66

77
.. towncrier release notes start
88
9+
web3.py v7.11.0 (2025-04-29)
10+
----------------------------
11+
12+
Bugfixes
13+
~~~~~~~~
14+
15+
- Checks that ``PersistentConnectionProvider`` response cache value is a dict before attempting to access it like one. Also adds checks to ``make_batch_request`` to make sure it is in batching mode before being called and is not after. (`#3642 <https://github.com/ethereum/web3.py/issues/3642>`__)
16+
- Moves base providers' ``_is_batching`` and ``_batch_request_func_cache`` from class to instance attrs to help with thread safety. (`#3661 <https://github.com/ethereum/web3.py/issues/3661>`__)
17+
18+
19+
Features
20+
~~~~~~~~
21+
22+
- Support for Prague network upgrade, mainly ``requests_hash`` and ``authorization_list`` formatters. Add support for serializing ``SignedSetCodeTransaction`` (`eth-account` pydantic model) directly added to transaction dicts. (`#3659 <https://github.com/ethereum/web3.py/issues/3659>`__)
23+
- Allow setting the ``request_information_cache_size`` for ``PersistentConnectionProvider`` implementations. (`#3662 <https://github.com/ethereum/web3.py/issues/3662>`__)
24+
25+
26+
Internal Changes - for web3.py Contributors
27+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
28+
29+
- Update some outdated TODO notes in code & remove old un-tested uncles tests as no longer relevant post-merge. (`#3605 <https://github.com/ethereum/web3.py/issues/3605>`__)
30+
- Run each integration test in isolation and parallelize, instead of running them all within a single `geth` (for example) process. This prevents muddied test contexts. (`#3659 <https://github.com/ethereum/web3.py/issues/3659>`__)
31+
- Bound hypothesis integers in some tests to a max of uint256 value (`#3665 <https://github.com/ethereum/web3.py/issues/3665>`__)
32+
- AsyncENS tests were xfailing for the wrong reason. (`#3675 <https://github.com/ethereum/web3.py/issues/3675>`__)
33+
34+
35+
Performance Improvements
36+
~~~~~~~~~~~~~~~~~~~~~~~~
37+
38+
- Optimize performance for:
39+
40+
* web3._utils.utility_methods.all_in_dict
41+
* web3._utils.utility_methods.any_in_dict
42+
* web3._utils.utility_methods.none_in_dict (`#3667 <https://github.com/ethereum/web3.py/issues/3667>`__)
43+
- optimize web3._utils.rpc_abi.apply_abi_formatters_to_dict (`#3671 <https://github.com/ethereum/web3.py/issues/3671>`__)
44+
45+
946
web3.py v7.10.0 (2025-03-27)
1047
----------------------------
1148

docs/web3.eth.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,8 @@ The following methods are available on the ``web3.eth`` namespace.
398398
399399
.. py:method:: Eth.get_uncle_by_block(block_identifier, uncle_index)
400400
401+
.. warning:: Deprecated. Will be removed in v8.
402+
401403
* Delegates to ``eth_getUncleByBlockHashAndIndex`` or
402404
``eth_getUncleByBlockNumberAndIndex`` RPC methods
403405

@@ -444,6 +446,8 @@ The following methods are available on the ``web3.eth`` namespace.
444446
445447
.. py:method:: Eth.get_uncle_count(block_identifier)
446448
449+
.. warning:: Deprecated. Will be removed in v8.
450+
447451
* Delegates to ``eth_getUncleCountByBlockHash`` or
448452
``eth_getUncleCountByBlockNumber`` RPC methods
449453

ens/exceptions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class AddressMismatch(ENSException):
3232
class InvalidName(idna.IDNAError, ENSException):
3333
"""
3434
Raised if the provided name does not meet the normalization
35-
standards specified in `ENSIP-15
35+
standards specified in `ENSIP-15`
3636
<https://docs.ens.domains/ens-improvement-proposals/ensip-15-normalization-standard>`_.
3737
"""
3838

newsfragments/3661.bugfix.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.

newsfragments/3662.feature.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.

newsfragments/3665.internal.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.

newsfragments/3667.performance.rst

Lines changed: 0 additions & 4 deletions
This file was deleted.

newsfragments/3671.performance.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.

newsfragments/3683.deprecation.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Deprecate eth.get_uncle* methods. Will be removed in v8.

newsfragments/3690.bugfix.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Properly handle ``PersistentConnectionClosedOK`` for ``subscription_manager.handle_subscriptions()``.

newsfragments/3692.internal.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Re-compile test contracts with new Solidity ``v0.8.30`` and re-generate integration test fixture to test against latest geth ``v1.15.11``.

newsfragments/3693.internal.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Remove old test fixtures when generating a new test fixture.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ name = "Removals"
127127
showcontent = true
128128

129129
[tool.bumpversion]
130-
current_version = "7.10.0"
130+
current_version = "7.11.0"
131131
parse = """
132132
(?P<major>\\d+)
133133
\\.(?P<minor>\\d+)

setup.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"tester": [
99
# Note: ethereum-maintained libraries in this list should be added to the
1010
# `install_pre_releases.py` script.
11-
"eth-tester[py-evm]>=0.12.0b1,<0.13.0b1",
11+
"eth-tester[py-evm]>=0.13.0b1,<0.14.0b1",
1212
"py-geth>=5.1.0",
1313
],
1414
"dev": [
@@ -55,7 +55,7 @@
5555
setup(
5656
name="web3",
5757
# *IMPORTANT*: Don't manually change the version here. See Contributing docs for the release process.
58-
version="7.10.0",
58+
version="7.11.0",
5959
description="""web3: A Python library for interacting with Ethereum""",
6060
long_description=long_description,
6161
long_description_content_type="text/markdown",
@@ -67,7 +67,7 @@
6767
# Note: ethereum-maintained libraries in this list should be added to the
6868
# `install_pre_releases.py` script.
6969
"eth-abi>=5.0.1",
70-
"eth-account>=0.13.1",
70+
"eth-account>=0.13.6",
7171
"eth-hash[pycryptodome]>=0.5.1",
7272
"eth-typing>=5.0.0",
7373
"eth-utils>=5.0.0",

tests/conftest.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,12 @@
1919
RequestMocker,
2020
)
2121

22-
from .utils import (
23-
get_open_port,
24-
)
25-
2622

2723
@pytest.fixture(scope="module", params=[lambda x: to_bytes(hexstr=x), identity])
2824
def address_conversion_func(request):
2925
return request.param
3026

3127

32-
@pytest.fixture()
33-
def open_port():
34-
return get_open_port()
35-
36-
3728
# --- session-scoped constants --- #
3829

3930

tests/core/eth-module/test_block_api.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ def test_get_block_formatters_with_null_values(w3, request_mocker):
4646
"blobGasUsed": None,
4747
"excessBlobGas": None,
4848
"parentBeaconBlockRoot": None,
49+
"requestsHash": None,
4950
}
5051
with request_mocker(w3, mock_results={"eth_getBlockByNumber": null_values_block}):
5152
received_block = w3.eth.get_block("pending")
@@ -109,6 +110,9 @@ def test_get_block_formatters_with_pre_formatted_values(w3, request_mocker):
109110
"parentBeaconBlockRoot": (
110111
"0x6470e77f1b8a55a49a57b3f74c2a10a76185636d65122053752ea5e4bb4dac59"
111112
),
113+
"requestsHash": (
114+
"0xe3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
115+
),
112116
}
113117

114118
with request_mocker(
@@ -170,4 +174,5 @@ def test_get_block_formatters_with_pre_formatted_values(w3, request_mocker):
170174
"parentBeaconBlockRoot": HexBytes(
171175
unformatted_values_block["parentBeaconBlockRoot"]
172176
),
177+
"requestsHash": HexBytes(unformatted_values_block["requestsHash"]),
173178
}

0 commit comments

Comments
 (0)