atomic gas charging#541
Draft
gballet wants to merge 5 commits intokaustinen-with-shapellafrom
Draft
Conversation
76d2964 to
7c123ee
Compare
gballet
commented
Apr 25, 2025
35d09b7 to
912098d
Compare
Signed-off-by: Guillaume Ballet <3272758+gballet@users.noreply.github.com>
912098d to
cb65ee0
Compare
jsign
reviewed
Apr 30, 2025
| gas1, wanted1 := aw.touchAddressAndChargeGas(addr, zeroTreeIndex, utils.BasicDataLeafKey, true, availableGas) | ||
| gas2, wanted2 := aw.touchAddressAndChargeGas(addr, zeroTreeIndex, utils.CodeHashLeafKey, true, availableGas-gas1) | ||
| return gas1 + gas2, wanted1 + wanted2 | ||
| func (aw *AccessWitness) TouchContractCreateInit(addr []byte, availableGas uint64) { |
Collaborator
There was a problem hiding this comment.
availableGas parameter is redundant
…contract Signed-off-by: Guillaume Ballet <3272758+gballet@users.noreply.github.com>
e5d5e09 to
4a2f6fb
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is an experiment to look into charging the gas "atomically" instead of on a per-leaf basis.
Differences are:
The principle is simple:
ErrOutOfGas, which will cause all the remaining gas to be consumed - this simplifies all the issues we had of knowing when there isn't enough gasTODO
len(ret) > 0partTestProcessVerkleto passshadowfork holeskyit seems that the fork itself has been broken due to lack of maintenance, if this is broken by it (it shouldn't) then it will be fixed during the rebasebenchmark how much is lost when passing variadic arguments, and if this is optimized out by using the stackthis is no longer needed as the API was changed to use a range instead.