-
Notifications
You must be signed in to change notification settings - Fork 837
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 EIP-4762 gas charging for contract account creation from code su… #7869
base: verkle
Are you sure you want to change the base?
Move EIP-4762 gas charging for contract account creation from code su… #7869
Conversation
…ccessfully created to transaction start Signed-off-by: Luis Pinto <[email protected]>
a525c77
to
cc7201a
Compare
@@ -288,6 +288,7 @@ public long touchAddressAndChargeGas( | |||
final int accessMode) { | |||
final short accessEvents = touchAddress(address, treeIndex, subIndex, accessMode); | |||
long gas = 0; | |||
LOG.atDebug().log(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"); |
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 think we can remove 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.
To me it is useful for debugging because it tells me what has been charged in a single touch call, because we could have multiple charges in one call.
Maybe we can do a pretty print at the end to show this information at once instead. I'll have a look
@@ -368,7 +369,7 @@ public long touchAddressAndChargeGas( | |||
+ " " | |||
+ gasView); | |||
} | |||
|
|||
LOG.atDebug().log("<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<"); |
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.
same here
String.format( | ||
"Not enough gas to cover proof of absence fee for %s: remaining gas = %d < %d = creation fee", | ||
frame.getContractAddress(), frame.getRemainingGas(), statelessGasCost))) { | ||
return; |
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.
do we need to return or set the state of the frame as we do here ?
frame.setExceptionalHaltReason(Optional.of(ExceptionalHaltReason.ILLEGAL_STATE_CHANGE));
frame.setState(MessageFrame.State.EXCEPTIONAL_HALT);
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.
is it Illegal state change? I think it is insufficient gas. It's already done inside handleInsufficientGas
…code successfully created to transaction start compact code for debug printing witness gas schedule Signed-off-by: Luis Pinto <[email protected]>
PR description
This fixes gas charges when creating contract where other clients are charging the contract account creation when nonce is incremented on the contract account and not when the code is completed. An issues was spotted where if the init code does not complete we were not applying any charges.