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
fix: eip1559 validation incorrectly adds gas price field #2099
Conversation
a8020fa
to
6025298
Compare
if ( | ||
generated_gas_price is not None | ||
and 'gasPrice' not in transaction | ||
and 'maxPriorityFeePerGas' not in transaction |
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.
I like this addition... so when we have a gas price strategy set but want to send an EIP-1559 transaction, we can still do so. I think I'd like to expand this to something like:
and 'maxPriorityFeePerGas' not in transaction | |
and all(_ not in transaction for _ in ('maxFeePerGas', 'maxPriorityFeePerGas')) |
This way, if only maxFeePerGas
is specified, we end up with a better message on why the exception was thrown. It won't be confusing that a gas price was added and conflicted, instead it will be that the maxPriorityFeePerGas
needs to be explicit for an EIP-1559 transaction.
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.
I also am going to encourage adding a test to eth_module for this. If you'd like I can throw one in on top of this change. Let me know.
newsfragments/2099.bugfix.txt
Outdated
@@ -0,0 +1 @@ | |||
Validation function was incorrectly adding `gasPrice` field to EIP-1559 transactions, which made them fail the mixed transaction type check. |
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.
I would add here that this was only when a gas price strategy is explicitly set
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.
This newsfragment also needs to be in .rst
format. This is why the build failed.
4abd314
to
a4559a4
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.
@fselmo LGTM once the error variants of the test are split out like we talked about! 🚢
4f3a7fd
to
18f6ba8
Compare
18f6ba8
to
2e690b7
Compare
@banteg thanks for the PR. I went ahead and added the tests I mentioned and merged so we can get this out in the next release. |
What was wrong?
When passing a correct EIP-1559 transaction with:
validate_transaction_params
appendsgasPrice
to it, which causes the subsequent check for mixed transaction type to fail.How was it fixed?
Expanded the condition to skip adding
gasPrice
whenmaxPriorityFeePerGas
key is present.Todo: