Skip to content

refactor(deps): migrate web3 from 6.11.0 to 7.14.1#211

Open
s0wa48 wants to merge 2 commits intoPolymarket:mainfrom
s0wa48:deps/upgrade-web3-7.14.1
Open

refactor(deps): migrate web3 from 6.11.0 to 7.14.1#211
s0wa48 wants to merge 2 commits intoPolymarket:mainfrom
s0wa48:deps/upgrade-web3-7.14.1

Conversation

@s0wa48
Copy link

@s0wa48 s0wa48 commented Mar 3, 2026

Changes

Dependency version bump

  • Updated web3 from 6.11.0 to 7.14.1 in requirements.txt

Breaking API changes addressed

geth_poa_middleware renamed to ExtraDataToPOAMiddleware

  • In web3 v7, geth_poa_middleware was removed and replaced with ExtraDataToPOAMiddleware
  • Updated the import in agents/polymarket/polymarket.py from geth_poa_middleware to ExtraDataToPOAMiddleware
  • If this middleware is injected into the Web3 middleware stack elsewhere in the file (e.g. w3.middleware_onion.inject(geth_poa_middleware, layer=0)), that call should also be updated to use ExtraDataToPOAMiddleware and the new add/inject API as appropriate for web3 v7

Notes

  • The Web3, Web3.HTTPProvider, and Web3.constants.MAX_INT APIs remain compatible
  • The eth-account, eth-keys, eth-utils, and related eth-* packages in requirements.txt may also need version updates to stay compatible with web3 v7; review their changelogs if runtime errors occur
  • No changes were needed in utils.py, trade.py, executor.py, or tests/test.py as they do not directly import from web3

This PR was auto-generated by Gittensor upgrade bot using Claude AI


Note

Medium Risk
Bumps web3 across a major version and updates the Polygon POA middleware hook, which can introduce runtime incompatibilities in transaction/signing or provider behavior.

Overview
Upgrades the Python web3 dependency from 6.11.0 to 7.14.1.

Updates agents/polymarket/polymarket.py to replace the removed geth_poa_middleware with ExtraDataToPOAMiddleware, and injects the new middleware into the Web3 middleware stack to keep Polygon POA RPC compatibility.

Written by Cursor Bugbot for commit f5b08a1. This will update automatically on new commits. Configure here.

@s0wa48
Copy link
Author

s0wa48 commented Mar 3, 2026

The original text 'self.web3.middleware_onion.inject(geth_poa_middleware, layer=0)' exists verbatim in the file, and the edit correctly updates the usage to match the already-imported ExtraDataToPOAMiddleware name, fixing the NameError described in the review comment.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

virtualenv==20.26.3
watchfiles==0.22.0
web3==6.11.0
web3==7.14.1
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Incompatible eth-typing and eth-utils versions for web3 v7

High Severity

Bumping web3 to 7.14.1 without updating its sub-dependencies causes an installation or runtime failure. web3==7.14.1 requires eth-typing>=5 and eth-utils>=5, but requirements.txt still pins eth-typing==4.4.0 and eth-utils==4.1.1. This version conflict will prevent the application from starting. The PR description even acknowledges these packages "may also need version updates" but doesn't actually apply them.

Additional Locations (1)

Fix in Cursor Fix in Web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant