Chore(deps): Bump web3 from 6.3 to 7.9.0#208
Conversation
Bumps [web3](https://github.com/ethereum/web3.py) from 6.3 to 7.9.0. - [Changelog](https://github.com/ethereum/web3.py/blob/main/docs/release_notes.rst) - [Commits](ethereum/web3.py@v6.3.0...v7.9.0) --- updated-dependencies: - dependency-name: web3 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
|
Failed to retrieve llama text: Invalid URL '/completion': No scheme supplied. Perhaps you meant https:///completion? |
foxpatch-aleph
left a comment
There was a problem hiding this comment.
This PR bumps web3 from 6.3 to 7.9.0, a major version upgrade with breaking API changes. Two breaking usages exist in the codebase: (1) geth_poa_middleware was removed in web3.py v7 — it's no longer needed as PoA support is now built-in, but the import and inject call are not updated; (2) SignedTransaction.rawTransaction was renamed to raw_transaction in web3.py v7. Both issues will cause import or runtime errors. The dependency pin change itself (to ==7.9.0) is reasonable in style, though a range like >=7.9.0,<8 would be more flexible. No tests cover these code paths with a live provider so CI likely won't catch these failures.
src/aleph/sdk/chains/ethereum.py (line 14): geth_poa_middleware was removed in web3.py v7. PoA chain support is now built-in and no longer requires explicit middleware injection. This import will fail with an ImportError at startup.
Remove this import and the inject call below (lines 90-92).
src/aleph/sdk/chains/ethereum.py (line 90): This block injects geth_poa_middleware which no longer exists in web3.py v7. Remove it entirely — web3.py v7 handles PoA chains natively without middleware.
# Remove these three lines:
self._provider.middleware_onion.inject(
geth_poa_middleware, "geth_poa", layer=0
)src/aleph/sdk/chains/ethereum.py (line 131): SignedTransaction.rawTransaction was renamed to raw_transaction (snake_case) in web3.py v7. This will raise AttributeError at runtime when sending transactions.
Change to:
tx_hash = self._provider.eth.send_raw_transaction(signed_tx.raw_transaction)pyproject.toml (line 44): Minor nit: pinning to an exact version (==7.9.0) is stricter than necessary and will require another PR for every patch release. Consider >=7.9.0,<8 to allow compatible updates automatically, consistent with how other deps like aiohttp and aleph-message are specified.
foxpatch-aleph
left a comment
There was a problem hiding this comment.
This PR bumps web3 from 6.3 to 7.9.0 but does not address the breaking API changes introduced in web3.py v7. The codebase uses at least three APIs that were changed or removed in v7, meaning this bump will cause runtime failures for BSC chain users and anyone sending transactions. The dependency pin should not be merged without fixing these incompatibilities.
src/aleph/sdk/chains/ethereum.py (line 14): geth_poa_middleware was removed in web3.py v7. It was renamed to ExtraDataToPOAMiddleware and moved to web3.middleware.proof_of_authority. This import will raise an ImportError at module load time.
Fix:
from web3.middleware import ExtraDataToPOAMiddlewaresrc/aleph/sdk/chains/ethereum.py (line 90): middleware_onion.inject(middleware, name, layer=0) changed in web3.py v7. The positional name argument was removed and the method signature is now middleware_onion.inject(middleware, layer=0). Additionally, the middleware itself should be updated to ExtraDataToPOAMiddleware.
Fix:
self._provider.middleware_onion.inject(ExtraDataToPOAMiddleware, layer=0)src/aleph/sdk/chains/ethereum.py (line 131): SignedTransaction.rawTransaction was renamed to raw_transaction (snake_case) in web3.py v7. This line will raise an AttributeError at runtime whenever a transaction is sent.
Fix:
tx_hash = self._provider.eth.send_raw_transaction(signed_tx.raw_transaction)
Bumps web3 from 6.3 to 7.9.0.
Changelog
Sourced from web3's changelog.