Skip to content

Conversation

@kais92
Copy link

@kais92 kais92 commented May 6, 2025

Breaking Changes

  • Renamed all .rawTransaction properties to .raw_transaction (Web3.py v7 naming).
  • Completely refactored middleware for Web3.py v7: now a class-based middleware using wrap_make_request.
  • Overhauled FlashbotProvider:
    • Replaced internal Web3 HTTP utils with requests.post.
    • Removed deprecated imports from eth_account._utils.

Added

  • Official compatibility with Web3.py v7 (7.x series).
  • New helper get_transaction_type() to detect legacy, access list, and EIP-1559 tx types.
  • Expanded tests covering _parse_signed_tx for legacy, EIP-2930 (type=1), and EIP-1559 (type=2) transactions.

Fixed

  • Ensured numeric RLP fields (bytes) are converted to int.
  • Added recovery of chainId for legacy transactions signed under EIP-155.
  • Updated examples (examples/simple.py) to use .raw_transaction and new middleware/provider APIs.

@odysseus0
Copy link
Collaborator

Pushed latest updates to this branch: added simulation test coverage and refreshed dependency/lockfile updates.

odysseus0 and others added 8 commits December 31, 2025 16:15
The gasPrice field was missing from the list of fields that get
converted from bytes to int, causing inconsistent behavior for
EIP-2930 access list transactions.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The function was added but never used in the codebase.
Removing to avoid dead code.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The timeout was hardcoded to 10 seconds. Users can now configure
it via the request_timeout parameter (default remains 10 seconds).

Also removes unused json import.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Change deprecated [tool.poetry.dev-dependencies] to
  [tool.poetry.group.dev.dependencies]
- Add pytest ^8.0.0 as explicit dev dependency

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Introduce domain-specific exceptions for better error handling:
- FlashbotsError: Base exception for all Flashbots errors
- FlashbotsTransactionError: Transaction-related errors
- InvalidTransactionError: Invalid/malformed transactions
- TransactionSignatureError: Signature verification failures
- BlockExtrapolationError: Block timestamp extrapolation errors
- FlashbotsProviderError: Provider-related errors
- FlashbotsRequestError: HTTP request failures

Also adds explicit __all__ exports in package __init__.py.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Replace assert statements with explicit validation using custom exceptions
- Replace lambda functions with list comprehensions for readability
- Add return type hints to simulate() and extrapolate_timestamp()
- Use sum() instead of reduce() for gas calculation
- Remove unused 'reduce' import

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Replace generic exception catching with specific handlers:
- requests.Timeout: Raised when request exceeds timeout
- requests.ConnectionError: Raised on connection failures
- requests.RequestException: Catch-all for other request errors

All exceptions are wrapped in FlashbotsRequestError with context.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Document new features and changes:
- Custom exception hierarchy
- Explicit __all__ exports
- Assert replacements with domain exceptions
- Lambda to list comprehension conversions
- Provider error handling improvements
- Return type hints additions

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@odysseus0 odysseus0 changed the title Feature/web3 v7 support Web3.py v7 support with code quality improvements Dec 31, 2025
- Convert pyproject.toml to PEP 621 format with hatchling backend
- Use [dependency-groups] for dev dependencies
- Replace poetry.lock with uv.lock
- Update README with uv commands
- Update linting instructions to use ruff

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@odysseus0 odysseus0 changed the title Web3.py v7 support with code quality improvements v3.0.0: Web3.py v7 support, uv migration, code quality improvements Dec 31, 2025
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.

3 participants