-
Notifications
You must be signed in to change notification settings - Fork 71
fix(core/vm): triple modexp cost post-cancun #32231 #2319
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -438,7 +438,9 @@ func (c *bigModExp) RequiredGas(input []byte) uint64 { | |
| gas.Mul(gas, adjExpLen) | ||
| } | ||
| // 2. Different divisor (`GQUADDIVISOR`) (3) | ||
| gas.Div(gas, big3) | ||
| if !c.eip7883 { | ||
| gas.Div(gas, big3) | ||
| } | ||
|
Comment on lines
+441
to
+443
|
||
| if gas.BitLen() > 64 { | ||
| return math.MaxUint64 | ||
| } | ||
|
|
||
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.
The inline comment says the divisor (GQUADDIVISOR) is 3, but with the new conditional the divisor becomes 1 when eip7883 is enabled (division is skipped). Please update the comment (and/or factor the divisor into a named variable) so the documented formula matches the implemented behavior for both modes.