-
Notifications
You must be signed in to change notification settings - Fork 381
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
Evm optimisations #5877
Evm optimisations #5877
Conversation
@@ -2066,6 +2060,10 @@ private CallResult ExecuteCall<TTracingInstructions>(EvmState vmState, byte[]? p | |||
} | |||
} | |||
|
|||
if (gasAvailable < 0) |
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.
What about underflow?
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.
Don't think any operation can charge 9.2 * 10^18 gas?
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.
Max would be SHA3 at 1.3 × 10^10 (2^31*6+30) for a 2 GiB SHA3 op
Other methods like create; sstore etc have their own checks
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.
Also, it could potentially change the workflow and traces? You are manipulating the stack now.
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.
Out of gas doesn't report stack; only changes I can see is it might report InvalidJumpDestination
or AccessViolation
as the error instead of OutOfGas
for a couple instructions as it now checks those conditions first; though would fail at the same instruction
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 could be seen as more helpful as if you increased the gas, its still going to fail 🤷♂️
Hive tests needed too. |
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.
Overall looks good, not sure about if it should be like that when tracing.
Should be the same, does the outofgas test prior to EndInstructionTrace |
Changes
UInt256
and operations on that type when can be done on smaller native type (e.g.ulong
)Vector256
clears rather thanSpan
.Slice
.Clear()
Types of changes
What types of changes does your code introduce?
Testing
Requires testing
If yes, did you write tests?