ethereum / web3.py

A python interface for interacting with the Ethereum blockchain and ecosystem.
http://web3py.readthedocs.io
MIT License
4.96k stars 1.69k forks source link

EIP1559 Send Transaction require to include the field: gasPrice #2071

Closed cristianberbecaru closed 3 years ago

cristianberbecaru commented 3 years ago

Hi,

When I run this code to send an EIP 1559 transaction, it gives me the following error:

TypeError: Transaction must include these fields: {'gasPrice'}

As I know, we don't need to add gasPrice anymore.

If I add the gasPrice, then it pops:"

TypeError: Transaction must not include unrecognized fields: {'maxFeePerGas', 'maxPriorityFeePerGas'}

Note: I'm using v5.21.0

signed_txn = w3.eth.account.sign_transaction(dict( nonce=w3.eth.get_transaction_count(public_address_of_senders_account), maxFeePerGas=3000000000, maxPriorityFeePerGas=2000000000, gas=100000, to='0xd3CdA913deB6f67967B99D67aCDFa1712C293601', value=12345, data=b'', ), private_key_for_senders_account, ) w3.eth.send_raw_transaction(signed_txn.rawTransaction) HexBytes('0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331')

fselmo commented 3 years ago

@cristianberbecaru Thanks for reporting on this. We have a ticket to track it here. The issue lies in sign_transaction. That had not yet been updated by geth to support the new fields. We reported this to their team and it was included in the new geth that was just released (#23179).

I'm going to work on the changes on our end now and we should have it available in our next release. I'm going to close this but please follow our issue #2065 for updates on when this has been implemented.

Thanks again!