- v5 Breaking Changes Summary
See the v5 Migration Guide
PR #1585 changed the error that was coming back from eth-tester when the Revert opcode was called, which broke some tests in downstream libraries. This PR reverts back to raising the original error. (#1813)
Added a new
ContractLogicErrorfor when a contract reverts a transaction.
SolidityError, in v6. (#1814)
Fix type annotations within the
eth.pymodule. Several arguments that defaulted to
Nonewere not declared
Fix type annotation warning when using string URI to instantiate an HTTP or WebsocketProvider. (#1669)
Fix type annotations within the
web3modules. Several arguments that defaulted to
Nonewere not declared
Accept a block identifier in the
Contract.estimateGasmethod. Includes a related upgrade of eth-tester to v0.5.0-beta.1. (#1639)
Introduce a more specific validation error,
ExtraDataLengthError. This enables tools to detect when someone may be connected to a POA network, for example, and provide a smoother developer experience. (#1666)
An update of
eth-testerincludes a change of the default fork from Constantinople to Muir Glacier. #1636
my_contract.events.MyEventwas incorrectly annotated so that
MyEventwas marked as a
ContractEventinstance. Fixed to be a class type, i.e.,
IPCProvider correctly handled
pathlib.Pathinput, but warned against its type. Fixed to permit Path objects in addition to strings. (#1647)
Upgrade eth-account to use v0.5.2+. eth-account 0.5.2 adds support for hd accounts
Also had to pin eth-keys to get dependencies to resolve. (#1622)
list_walletsmethod to the
Added block_identifier parameter to ContractConstructor.estimateGas method. (#1588)
Add snake_case methods to Geth and Parity Personal Modules.
Deprecate camelCase methods. (#1589)
Added new weighted keyword argument to the time based gas price strategy.
True, it will more give more weight to more recent block times. (#1614)
Adds support for Solidity’s new(ish) receive function.
Adds a new contract API that mirrors the existing fallback API:
Fixed hasattr overloader method in the web3.ContractEvent, web3.ContractFunction, and web3.ContractCaller classes by implementing a try/except handler that returns False if an exception is raised in the __getattr__ overloader method (since __getattr__ HAS to be called in every __hasattr__ call).
Created two new Exception classes, ‘ABIEventFunctionNotFound’ and ‘ABIFunctionNotFound’, which inherit from both AttributeError and MismatchedABI, and replaced the MismatchedABI raises in ContractEvent, ContractFunction, and ContractCaller with a raise to the created class in the __getattr__ overloader method of the object. (#1594)
Change return type of rpc_gas_price_strategy from int to Wei (#1612)
Fix typo in “Internals” docs. Changed asyncronous –> asynchronous (#1607)
Improve documentation that introduces and troubleshoots Providers. (#1609)
Add documentation for when to use each transaction method. (#1610)
Remove incorrect web3 for w3 in doc example (#1615)
Add examples for using web3.contract via the ethpm module. (#1617)
Add dark mode to documentation. Also fixes a bunch of formatting issues in docs. (#1626)
Add snake_case methods for the net module
Also moved net module to use ModuleV2 instead of Module (#1592)
Minor bugfix in how ContractCaller looks up abi functions. (#1552)
Update modules to use compatible typing-extensions import. (#1554)
Make ‘from’ and ‘to’ fields checksum addresses in returned transaction receipts (#1562)
Use local Trinity’s IPC socket if it is available, for newer versions of Trinity. (#1563)
Web3 5.1.0 (2019-09-18)¶
Remove whitespace, move
topicin Geth docs (#1425)
Enforce stricter doc checking, turning warnings into errors to fail CI builds to catch issues quickly.
web3.tools.rstto the table of contents and fix incorrectly formatted JSON example. (#1437)
Add example using Geth POA Middleware with Infura Rinkeby Node (#1444)
Released August 22, 2019
[ethPM] Fix bug in package id and release id fetching strategy - #1427
Released August 15, 2019
Released August 1, 2019
web3.eth.chainIdnow returns an integer instead of hex - #1394
Deprecation Warnings now show for methods that have a
@combomethoddecorator - #1401
[ethPM] Add ethPM to the docker file - #1405
Released July 31, 2019
This is intended to be the final release before the stable v5 release.
Remove doctest dependency on ethtoken - #1395
[ethPM] Bypass IPFS validation for large files - #1393
Released July 18,2019
Released July 15, 2019
Remove full IDNA processing in favor of UTS46 - #1364
Migrate py-ethpm library to web3/ethpm - #1379
Relax canonical address requirement in ethPM - #1380
Replace ethPM’s infura strategy with web3’s native infura support - #1383
eth.chainIdin default transaction params - #1378
Released May 13, 2019
Released May 6, 2019
Released April 24, 2019
Released April 15, 2019
Add getLogs by blockHash - #1269
Implement chainId endpoint - #1295
Moved non-standard JSON-RPC endpoints to applicable Parity/Geth docs. Deprecated
Moved Whisper endpoints to applicable Geth or Parity namespace - #1308
Added support for Goerli provider - #1286
Added addReservedPeer to Parity module - #1311
Released March 26, 2019
Released March 20, 2019
web3/utilsdirectory in favor of
Relocated personal RPC endpoints to Parity and Geth class - #1211
Relocated eth_protocolVersion and web3_clientVersion - #1274
Relocated admin module to Geth namespace - #1288
Relocated miner module to Geth namespace - #1287
Added v5 migration docs - #1284
Released March 11, 2019
Released February 25th, 2019
Released February 13th, 2019
transactmethods - #1232
Released January 23rd, 2019
Released January 15th, 2019
manager.providersfrom list to single
web3.keccakmethod - #1207
Drop auto detect testnets for IPCProvider - #1206
Add check to make sure blockHash exists - #1158
Remove some unreachable code in providers/base.py - #1160
Migrate tester provider results from middleware to defaults - #1188
Fix doc formatting for build_filter method - #1187
Add ERC20 example in docs - #1178
Convert Web3 instance variables to w3 - #1186
Update eth-utils dependencies and clean up other dependencies - #1195
Released December 20th, 2018
Remove support for python3.5, drop support for eth-abi v1 - #1163
Support for custom ReleaseManager was fixed - #1165
Released December 13th, 2018
Add Rinkeby and Kovan Infura networks; made mainnet the default - #1150
listStorageKeysRPC - #1145
Web3.solidityKeccakinstead. - #1139
Add default trinity locations to IPC path guesser - #1121
Add wss to
Add timeout for
Receipt timeout raises
Allow specification of block number for
Released October 28, 2018
Released September 25th, 2018
Released September 11th, 2018
old pip bug used during release made it impossible for non-windows users to install 4.7.0.
Released September 10th, 2018
Misc - Upgrade eth-tester to 0.1.0-beta.32, and remove integration tests for py-ethereum. - Upgrade eth-hash to 0.2.0 with pycryptodome 3.6.6 which resolves a vulnerability.
Released Aug 24, 2018
Disallow configuring filters with both manual and generated topic lists - #976
Add support for the upcoming eth-abi v2, which does ABI string decoding differently - #974
Add a lot more filter tests - #997
Add more tests for filtering with
None. Note that geth & parity differ here. - #985
Docs: add an example of interacting with an ERC20 contract - #995
A couple doc typo fixes
Released July 30, 2018
Accept addresses supplied in
bytesformat (which does not provide checksum validation)
Improve estimation of gas prices
Test Parity 1.11.7
Parity integration tests upgrade to use sha256 instead of md5
Fix some filter docs
eth-account upgrade to v0.3.0
eth-tester upgrade to v0.1.0-beta.29
Released June 29, 2018
Released June 21, 2018
Add support for https in WEB3_PROVIDER_URI environment variable
Can send websocket connection parameters in
Two new auto-initialization options:
from web3.auto.gethdev import w3
from web3.auto.infura import w3(After setting the
Alpha support for a new package management tool based on ethpm-spec, see Package Manager API
Can now receive large responses in
WebsocketProviderby specifying a large
max_sizein the websocket connection parameters.
Released June 6, 2018
Support for the ABI types like: fixedMxN which is used by Vyper.
In-flight transaction-signing middleware: Use local keys as if they were hosted keys using the new
Add several new Parity trace functions
New API to resolve ambiguous function calls, for example:
Two functions with the same name that accept similar argument types, like
myfunc(int8), and you want to call
See how to use it at: Invoke Ambiguous Contract Functions Example
Gas estimation doesn’t crash, when 0 blocks are available. (ie~ on the genesis block)
Close out all HTTPProvider sessions, to squash warnings on exit
Stop adding Contract address twice to the filter. It was making some nodes unhappy
Friendlier json encoding/decoding failure error messages
Performance improvements, when the responses from the node are large (by reducing the number of times we evaluate if the response is valid json)
Parity CI test fixes (ugh, environment setup hell, thanks to the community for cleaning this up!)
Don’t crash when requesting a transaction that was created with the parity bug (which allowed an unsigned transaction to be included, so
Doc fixes: addresses must be checksummed (or ENS names on mainnet)
Enable local integration testing of parity on non-Debian OS
Testing setup for devs
Change the build badge from Travis to Circle CI
Cache the parity binary in Circle CI, to reduce the impact of their binary API going down
Dropped the dot:
Released May 9, 2018
Improved error message when connecting to a geth-style PoA network
Improved error message when address is not checksummed
Started in on support for
Lots of documentation upgrades, including:
Guide for understanding nodes/networks/connections
Simplified Quickstart with notes for common issues
A new Troubleshooting section
Potential pypy performance improvements (use toolz instead of cytoolz)
eth-tester upgraded to beta 24
Released Apr 25, 2018
Removed audit warning and opt-in requirement for
w3.eth.account. See more in: Working with Local Private Keys
Added an API to look up contract functions:
fn = contract.functions['function_name_here']
Upgrade Whisper (shh) module to use v6 API
Bugfix: set ‘to’ field of transaction to empty when using
transaction = contract.constructor().buildTransaction()
You can now specify nonce in
Distinguish between chain id and network id – currently always return None for
Better error message when trying to use a contract function that has 0 or >1 matches
Better error message when trying to install on a python version <3.5
Installs pypiwin32 during pip install, for a better Windows experience
Cleaned up a lot of test warnings by upgrading from deprecated APIs, especially from the deprecated
contract.deploy(txn_dict, args=contract_args)to the new
Documentation typo fixes
Better template for Pull Requests
Released Apr 9, 2018
WebsocketProvider. If you’re looking for better performance than HTTP, check out websockets.
Added name collision detection to ConciseContract and ImplicitContract
Bugfix to allow fromBlock set to 0 in createFilter, like
Bugfix of ENS automatic connection
eth-tester support for Byzantium
New migration guide for v3 -> v4 upgrade
Various documentation updates
Pinned eth-account to older version
Released Apr 2, 2018
Marked beta.13 as stable
Released Mar 27, 2018
This is intended to be the final release before the stable v4 release.
Add support for geth 1.8 (fixed error on
You can now call a contract method at a specific block with the
block_identifierkeyword argument, see:
In preparation for stable release, disable
w3.eth.accountby default, until a third-party audit is complete & resolved.
New API for contract deployment, which enables gas estimation, local signing, etc. See
Find contract events with contract.events.$my_event.createFilter()
Support auto-complete for contract methods.
Upgrade most dependencies to stable
not included: eth-tester and eth-account
Switch the default EthereumTesterProvider backend from eth-testrpc to eth-tester:
A lot of documentation improvements
Test node integrations over a variety of providers
geth 1.8 test suite
A little hiccup on release. Skipped.
Released Feb 28, 2018
Released Feb 21, 2018
bugfix: Compatibility with eth-utils v1-beta2 (the incompatibility was causing fresh web3.py installs to fail)
bugfix: crash when sending the output of
sendTransaction(). Now, having a chainID key does not crash sendTransaction.
bugfix: a TypeError when estimating gas like:
Added parity integration tests to the continuous integration suite!
Some py3 and docs cleanup
Released Feb 8, 2018
Access event log parameters as attributes
Support for specifying nonce in eth-tester
Bugfix dependency conflicts between eth-utils, eth-abi, and eth-tester
Clearer error message when invalid keywords provided to contract constructor function
New docs for working with private keys + set up doctests
First parity integration tests
replace internal implementation of w3.eth.account with
Released Feb 7, 2018, then recalled. It added 32MB of test data to git history, so the tag was deleted, as well as the corresponding release. (Although the release would not have contained that test data)
Released Jan 29, 2018
web3.eth.Eth.getLogs()in eth-tester with py-evm
Process transaction receipts with Event ABI, using Contract.events.myEvent(*args, **kwargs).processReceipt(transaction_receipt) see Event Log Object for the new type.
Add timeout parameter to
bugfix: make sure idna package is always installed
Replace ethtestrpc with py-evm, in all tests
Test refactoring & cleanup
Reduced warnings during tests
Released Jan 18, 2018
New contract function call API: my_contract.functions.my_func().call() is preferred over the now deprecated my_contract.call().my_func() API.
A new, sophisticated gas estimation algorithm, based on the https://ethgasstation.info approach. You must opt-in to the new approach, because it’s quite slow. We recommend using the new caching middleware. See
New caching middleware that can cache based on time, block, or indefinitely.
Automatically retry JSON-RPC requests over HTTP, a few times.
ConciseContract now has the address directly
Many eth-tester fixes.
web3.providers.eth_tester.main.EthereumTesterProvideris now a legitimate alternative to
ethtest-rpc removed from testing. Tests use eth-tester only, on pyethereum. Soon it will be eth-tester with py-evm.
Bumped several dependencies, like eth-tester
Released Dec 28, 2017
Improvements to working with eth-tester, using
Bugfix the key names in event logging
Add support for
IPCProvidernow automatically retries on a broken connection, like when you restart your node
New gas price engine API, laying groundwork for more advanced gas pricing strategies
Released Dec 7, 2017
buildTransaction()method to prepare contract transactions, offline
New automatic provider detection, for
w3 = Web3()initialization
Set environment variable WEB3_PROVIDER_URI to suggest a provider for automatic detection
New API to set providers like:
w3.providers = [IPCProvider()]
web3.eth.Eth.filter()when retrieving logs with the argument ‘latest’
Bump eth-tester to v0.1.0-beta.5, with bugfix for filtering by topic
Removed GPL lib
pylru, now believed to be in full MIT license compliance.
Released Dec 1, 2017
Fix encoding of ABI types:
Windows connection error bugfix
Bugfix message signatures that were broken ~1% of the time (zero-pad
Autoinit web3 now produces None instead of raising an exception on
from web3.auto import w3
Clearer errors on formatting failure (includes field name that failed)
Python modernization, removing Py2 compatibility cruft
Update dependencies with changed names, now:
Faster Travis CI builds, with cached geth binary
Released Nov 22, 2017
sendRawTransaction()accepts raw bytes
contract()accepts an ENS name as contract address
signTransaction()returns the expected hash (after signing the transaction)
Accountmethods can all be called statically, like:
statusfield as an
Web3.soliditySha3()looks up ENS names if they are supplied with an “address” ABI
If running multiple threads with the same w3 instance,
ValueError: Recursively called ...is no longer raised
Plus, various python modernization code cleanups, and testing against geth 1.7.2.
Python 3 is now required
ENS names can be used anywhere that a hex address can
Sign transactions and messages with local private keys
Quick automatic initialization with
from web3.auto import w3
All addresses must be supplied with an EIP-55 checksum
All addresses are returned with a checksum
toInt(), see: Encoding and Decoding Helpers
All filter calls are synchronous, gevent integration dropped
eventFilter()has replaced both
Contract arguments of
bytesABI type now accept hex strings.
Contract arguments of
stringABI type now accept python
Contract return values of
stringABI type now return python
Many methods now return a
bytes-like object where they used to return a hex string, like in
IPC connection left open and reused, rather than opened and closed on each call
A number of deprecated methods from v3 were removed
ethereum-testeras a dependency
Addition of named middlewares for easier manipulation of middleware stack.
Provider middlewares can no longer be modified during runtime.
Experimental custom ABI normalization API for Contract objects.
Change docs to use RTD theme
functiontype abi encoding via
Web3.toHexto conform to RPC spec.
Fix PyPi readme text.
Fix PyPi readme text.
Various bugfixes introduced in middleware API introduction and migration to formatter middleware.
Bugfix for formatter handling of contract creation transaction.
Improved testing infrastructure.
Bugfix for retrieving filter changes for both new block filters and pending transaction filters.
New Middleware API
Support for multiple providers
Remove multiple functions that were never implemented from the original web3.
Deprecated password prompt within
Bugfix for abi filtering to correctly handle
fallbacktype abi entries.
All web3 apis which accept
addressparameters now enforce checksums if the address looks like it is checksummed.
Improvements to error messaging with when calling a contract on a node that may not be fully synced
web3.eth.syncingto correctly handle
Web3 now returns
web3.utils.datastructures.AttributeDictin places where it previously returned a normal
web3.eth.contractnow performs validation on the
Add validation for the
Contract return values of
stringare no longer converted to text types and will be returned in their raw byte-string format.
eth_signdouble hashing input.
Update pyrlp dependency to
Update eth-testrpc dependency to
upstream version bump for bugfix in eth-abi-utils
eth.defaultAccountdefaulting to the coinbase account.
Fix error message from contract factory creation.
ethereum-utilsfor utility functions.
ethereum-abi-utilsdependency for upstream bugfix.
Contract.code: replaced by
Contract.code_runtime: replaced by
sourceas arguments for the
sourceas a property of the
Bugfix for how
requestslibrary is used. Now reuses session.
Bugfix for construction of
HTTPProviderto be imported from
HTTPProvideraccessible as a property of
Remove hard dependency on gevent.
web3.eth.getTransactionwhen the hash is unknown.
Bugfix for event log data decoding to properly handle dynamic sized values.
web3.testermodule to access extra RPC functionality from
Fix package so that
eth-testrpcis not required.
Bugfix for contract instances to respect
Better error reporting when ABI decoding fails for contract method response.
EthereumTesterProvidernow available. Faster test runs than
Updated underlying eth-testrpc requirement.
web3.shhis now implemented.
KeepAliveRPCProviderto correctly recycle HTTP connections and use HTTP keep alive
Bugfix for contract transaction sending not respecting the
New DelegatedSigningManager and PrivateKeySigningManager classes.
Bugfix or IPCProvider not handling large JSON responses well.
Better RPC compliance to be compatable with the Parity JSON-RPC server.
Filterobjects now support controlling the interval through which they poll using the
Bugfix generation of event topics.
Web3.Iban now allows access to Iban address tools.
geth.ipcpath on linux systems.
- Changes to the
Contract.deploy()parameter arguments renamed to args
Contract.deploy()now takes args and kwargs parameters to allow constructing with keyword arguments or positional arguments.
Contract.pastEventsnow allows you to specify a
fromBlock or ``toBlock.Previously these were forced to be
Contract.estimateGasare now callable as class methods as well as instance methods. When called this way, an address must be provided with the transaction parameter.
Contract.estimateGasnow allow specifying an alternate address for the transaction.
- Changes to the
RPCProvidernow supports the following constructor arguments.
sslfor enabling SSL
network_timeoutfor controlling the timeouts for requests.
Bugfix: Fix KeyError in merge_args_and_kwargs helper fn.
Bugfix for usage of block identifiers ‘latest’, ‘earliest’, ‘pending’
Non-data transactions now default to 90000 gas.
Web3 object now has helpers set as static methods rather than being set at initialization.
RPCProvider now takes a
pathparameter to allow configuration for requests to go to paths other than
TestRPCProvider no longer dumps logging output to stdout and stderr.
Bugfix for return types of
Bugfix for event data types of
All transactions which contain a
dataelement will now have their gas automatically estimated with 100k additional buffer. This was previously only true with transactions initiated from a
Contract functions can now be called using keyword arguments.
Upstream fixes for filters
pastEventsnow callable as both instance and class methods.
The filters that come back from the contract
pastEventsmethods now call their callbacks with the same data format as
Cast RPCProvider port to an integer.
Remove all monkeypatching
Pull in downstream updates to proper gevent usage.
Bugfix with contract operations mutating the transaction object that is passed in.
More explicit linting ignore statements.
BugFix: fix for python3 only
RPCProvidernot sending a content-type header
web3.toWeinow returns an integer instead of a decimal.Decimal
TestRPCProvidercan now be imported directly from
Bugfix: Format the return value of
Bugfix: IPCProvider socket interactions are now more robust.
Downstream package upgrades for
ethereum-tester-clientto handle configuration of the Homestead and DAO fork block numbers.
web3.contract.Contractto expose it for static analysis and auto completion tools
Allow passing string parameters to functions
Automatically compute gas requirements for contract deployment and
Block, Transaction, and Log filters
Fixes for encoding.
Bugfix to allow address types in constructor arguments.
Partial implementation of the
Restructure project modules to be more flat
Add ability to run test suite without the slow tests.
encodingutils into smaller modules.
Basic pep8 formatting.
Apply python naming conventions to internal APIs
Lots of minor bugfixes.
Removal of dead code left behing from
Add test coverage for
Massive refactor to the majority of the app.