Web3.py in London

Ethereum's next network upgrade, dubbed London, is live on the Ropsten testnet, with other testnets soon to follow. A summary of the London updates can be found here, and a timeline of the London rollout can be found here.

As it relates to Web3.py, there are only a couple of changes to get up to speed with:

  1. a new transaction fee concept introduced by EIP-1559 and, related,
  2. blocks now specify a minimum transaction fee, baseFeePerGas.

Re: new transaction fee concept, this boils down to the introduction of two new transaction fields: maxFeePerGas and maxPriorityFeePerGas. These fields replace gasPrice and enable a more efficient fee marketplace.

A few things to note:

  • Transactions that include gasPrice are now labeled as "legacy" transactions and are still valid. However, you can expect them to be more expensive than 1559-style transactions.
  • Transactions that use a combination of gasPrice and maxFeePerGas/maxPriorityFeePerGas will raise an error.
  • Transactions that omit gasPrice, maxFeePerGas, and maxPriorityFeePerGas will default to the new 1559-style transaction. Web3.py and/or your Ethereum client will find reasonable numbers for those values.
  • New transaction documentation can be found here.

If you're ready to test out the new changes on Ropsten (and soon elsewhere), you can pull in the london branch of Web3.py into your project via: pip install https://github.com/ethereum/web3.py/archive/london.zip.

This London branch will continue to be polished up until Mainnet release and beyond. We would love your help testing the new features and their edge cases. If you find anything fishy, please open an issue in GitHub repo and thanks for being an early adopter!