-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merge bulk of London support to master #2060
Conversation
c5d3b60
to
d8a6177
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hooray! We're so close!
There were a few things I noticed when manually testing:
- I think
sign_transaction
still needs to be updated to support 1559. If I send a tx with both 1559 and legacy fields, I get a ValueError back from Geth, rather than our web3TransactionTypeMismatch
error - In the same vein, if I
sign_transaction
with an int in themaxFeePerGas
field:
w3.eth.sign_transaction({
'from': w3.eth.default_account,
'to': acct2,
'value': 100,
'maxFeePerGas': 3000000000,
'nonce': w3.eth.get_transaction_count(w3.eth.default_account),
})
I get an invalid argument 0: json: cannot unmarshal non-string into Go struct field TransactionArgs.maxFeePerGas of type *hexutil.Big"
error.
- It's probably also worth writing a few integration tests for
replace_transaction
andmodify_transaction
to prove to ourselves that we can handle both legacy and 1559 transaction params with those two methods. A quick look suggests that we'll at least need to add the new keys to theVALID_TRANSACTION_PARAMS
inweb3/_utils/transactions.py
but there may be other things that need to be done as well. - It may be worth adding a note to the docs for the Gas Price API and/or
w3.eth.generate_gas_price
that those will only work for legacy transactions
Thanks for all of your work on this!
I did change most of the relevant I'll also add some clarification on the gas price strategy to the docs 👌 And just going to mark it here that, as we saw earlier, geth's |
2d94953
to
6ee262d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome! This looks good to me! 🚀
…debugging / curiosity
- Fixed tests that were failing from the implementation of the new EIP-1559 fields (maxFeePerGas and maxPriorityFeePerGas). Updated most of our existing tests to use these new fields in order to encourage their use / be updated to the new standard. - Updated documentation around unit and integration testing and how to contribute to our test suite.
Some of our tests had 'gasPrice' set too low. This would cause those transactions to sit in the tx pool - often interfering with other tests that were either looking for a mined transaction or looking to be included in the pending block. This commit attempts to fix that and turn some tests that were previously failing back on.
Added London support for the async eth_sendTransaction calls. Also added back the gas price strategy for calls that have a gas price strategy explicitly set and do not have a 'gasPrice' set. This is mostly so we do not introduce a breaking change when it comes to setting a strategy for legacy txns.
Cleaned up some setup that we had tested against before geth released v1.10.4 with London support. Turned a unit test for gas price strategy back on now that we added back support for it.
Added support for maxFeePerGas and maxPriorityFeePerGas to the modify_transaction method. Updated most function examples throughout the docs to use maxFeePerGas and maxPriorityFeePerGas over gasPrice. Consolidated the newsfragments for EIP-1559 updates to one feature update and used the london branch PR number for the fragment.
Hi, I was trying to sign a tx with the latest web3.py which is 5.21.0.
and it gave me this error
Any idea on how to solve it? I think it should support maxFeePerGas when signing the tx |
Hey @qiushui777. These changes are going to be on the next release. Sorry for the inconvenience. For now you can get around this by installing web3py from the latest This next release will come out early this next week if not tomorrow. |
@qiushui777 Version |
What was wrong?
maxFeePerGas
andmaxPriorityFeePerGas
Related to Issue # 1835
How was it fixed?
maxFeePerGas
andmaxPriorityFeePerGas
was added, mainly to thesendTransaction
RPC call and internalreplace_transaction
andmodify_transaction
methods.Todo:
- [ ] Add entry to the release notes^ The separate commits in this branch have their appropriate release notes
Cute Animal Picture