-
Notifications
You must be signed in to change notification settings - Fork 878
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
Move gas refund calculation from MainnetTransactionProcessor to GasCalculator #8106
Move gas refund calculation from MainnetTransactionProcessor to GasCalculator #8106
Conversation
6118848
to
0b3870e
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.
Some minor comments.
I have spiked out the complete EIP-7623 and tested against devnet5 spec tests in this PR: #8117
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.
There's already several pieces of refund logic scattered across the GasCalculators, most recently calculateDelegateCodeGasRefund
.
I think it's confusing to have refund logic both in RefundCalculator classes and in the GasCalculator classes, would prefer one or the other.
I have a slight preference for putting this logic into the GasCalculator classes since it's a smaller change than extracting all the other refund logic.
Won't block the PR on it.
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.
Alternatively, if it makes sense to make this a very precise type of RefundCalculator with a precise name, then maybe it works. Not sure what that name would be and if this is sufficiently isolated enough from the other refund logic.
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.
@siladu I think you are right, I've moved the logic to the GasCalculator and got rid of the RefundCalculator
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.
❤️
…dCalculator Signed-off-by: Daniel Lehrner <[email protected]>
Signed-off-by: Daniel Lehrner <[email protected]>
Signed-off-by: Daniel Lehrner <[email protected]>
Signed-off-by: Daniel Lehrner <[email protected]>
Signed-off-by: Daniel Lehrner <[email protected]>
Signed-off-by: Daniel Lehrner <[email protected]>
0b3870e
to
894d7b2
Compare
PR description
Because of EIP-7623 the gas refund calculation will change with the upcoming Prague hard fork. Right now this calculation is hardcoded in
MainnetTransactionProcessor
. This PR moves this calculation to theGasCalculator
, which allows to change the refund calculation with a new hardfork.Thanks for sending a pull request! Have you done the following?
doc-change-required
label to this PR if updates are required.Locally, you can run these tests to catch failures early:
./gradlew build
./gradlew acceptanceTest
./gradlew integrationTest
./gradlew ethereum:referenceTests:referenceTests