-
Notifications
You must be signed in to change notification settings - Fork 879
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
Split Transaction Gas Calculation from EVM Calculation #2659
Conversation
In preparation for the EVM library pull out the transaction related gas calculations and move them into their own `TransactionGasCalculator.` This has 4 calls right now, none of which occur inside the EVM: * Intrinsic gas cost * Code Deposit gas cost * Max refund quotient * Max Privacy Marker Transaction intrinsic gas cost. Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
* | ||
* <ul> | ||
* <li><b>Operation Gas Deductions:</b> Deducting the operation's gas cost from the VM's current | ||
* message frame because the |
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.
finish sentence
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.
That incomplete sentence dates back to Pantheon code. But because I touched it I get to fix 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.
It's only fair.
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.
done
public interface TransactionGasCalculator { | ||
|
||
/** | ||
* Returns a {@link Transaction}s intrinsic gas cost, i.e. the cost deriving from it's encoded |
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.
typo it's
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.
done
/** | ||
* Provides various gas cost lookups and calculations used during block processing. | ||
* | ||
* <p>The {@code GasCalculator} is meant to encapsulate all {@link Gas}-related calculations except |
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.
s/GasCalculator/TransactionGasCalculator
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.
done
Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
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.
Looks good, just a minor bit of copypasta in javadoc
ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/TransactionGasCalculator.java
Outdated
Show resolved
Hide resolved
…nsactionGasCalc Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
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.
🚢
Thanks Gary. |
) In preparation for the EVM library pull out the transaction related gas calculations and move them into their own `TransactionGasCalculator.` This has 4 calls right now, none of which occur inside the EVM: * Intrinsic gas cost * Code Deposit gas cost * Max refund quotient * Max Privacy Marker Transaction intrinsic gas cost. Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
In preparation for the EVM library pull out the transaction related gas
calculations and move them into their own
TransactionGasCalculator.
This has 4 calls right now, none of which occur inside the EVM:
Signed-off-by: Danno Ferrin danno.ferrin@gmail.com
Changelog