-
Notifications
You must be signed in to change notification settings - Fork 135
Instrument CREATE and CREATE2 gas func #489
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
base: instrument_call_gas_func
Are you sure you want to change the base?
Instrument CREATE and CREATE2 gas func #489
Conversation
@@ -327,15 +327,15 @@ func gasCreate2(evm *EVM, contract *Contract, stack *Stack, mem *Memory, memoryS | |||
if wordGas, overflow = math.SafeMul(toWordSize(wordGas), params.Keccak256WordGas); overflow { | |||
return multigas.ZeroGas(), 0, ErrGasUintOverflow | |||
} | |||
// TODO(NIT-3484): Update multi dimensional gas here | |||
if gas, overflow = math.SafeAdd(gas, wordGas); overflow { | |||
if overflow = multiGas.SafeIncrement(multigas.ResourceKindComputation, wordGas); overflow { |
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.
CREATE / CREATE2 are pure computation cost:
Computation: initCodeCost + memExpansionCost + params.CreateGas + hashCost, |
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.
Shouldn't this be an inline comment rather than a PR conversation comment?
Like we want the reasoning to be available to folks reading the code.
@@ -327,15 +327,15 @@ func gasCreate2(evm *EVM, contract *Contract, stack *Stack, mem *Memory, memoryS | |||
if wordGas, overflow = math.SafeMul(toWordSize(wordGas), params.Keccak256WordGas); overflow { | |||
return multigas.ZeroGas(), 0, ErrGasUintOverflow | |||
} | |||
// TODO(NIT-3484): Update multi dimensional gas here | |||
if gas, overflow = math.SafeAdd(gas, wordGas); overflow { | |||
if overflow = multiGas.SafeIncrement(multigas.ResourceKindComputation, wordGas); overflow { |
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.
Shouldn't this be an inline comment rather than a PR conversation comment?
Like we want the reasoning to be available to folks reading the code.
For NIT-3482
Instrument CREATE and CREATE2 opcode with multigas calculations:
gasCreate2
funcgasCreateEip3860
for EIP-3860 (introduce init code size)Note: waits #486 to be merged, temporary points on
instrument_call_gas_func
branch