-
Notifications
You must be signed in to change notification settings - Fork 135
Instrument the CALL, CALLCODE, DELEGATECALL and STATICCALL opcodes #486
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
Open
MishkaRogachev
wants to merge
8
commits into
cbp-feature
Choose a base branch
from
instrument_call_gas_func
base: cbp-feature
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+564
−46
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
970caeb
Instrument `gasCall` with multi gas
MishkaRogachev 01bcf64
Instrument `gasCallCode` with multi gas and unify the test scenario
MishkaRogachev c0bc014
Instrument `makeCallVariantGasCallEIP2929` with multi gas
MishkaRogachev 983b1fa
Fixup gas operations test name
MishkaRogachev d694447
Instrument `makeCallVariantGasEIP4762` with multi gas
MishkaRogachev 5e78561
Instrument `gasDelegateCall` and `gasStaticCall` with multi gas
MishkaRogachev 2661c91
Instrument `makeCallVariantGasCallEIP7702` with multi gas
MishkaRogachev 0665b84
Fix resource kind and callGas parameter in `gasCall` and `gasCallCode`
MishkaRogachev File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
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.
How did you decide to allocate this to computation gas?
Is that what Tyler's tracer did?
I would have guessed (possibly, incorrectly) that gas for expanding memory would be state growth 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.
My assumption was based on this statement, and here and in all following places I have treated memory operations as computation cost since there are no appeals on statedb. Please correct me if I'm wrong
Uh oh!
There was an error while loading. Please reload this page.
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.
Okay. So, this is, at least, consistent with what Tyler has done in the tracer. Good.
Now, though, I do need to understand why that's the right behavior.
Maybe I don't understand what the difference is between memory expansion and the storage in the statedb.
By way of analogy, are we saying that the "memory" of the EVM is similar to RAM on a real machine. And, that entries in the statedb are more like "disk"? And, so, when we talk about "state growth" and "state access" we are only talking about the equivalent of disk growth and i/o? And that "memory" is only what has to be paged into the working memory of the VM to support the computations which are happening while processing the transactions and even though the values of the allocated memory are part of what makes up the global state root, it's not really part of the "state" we're talking about when we talk about "state growth" or "state access?"
@tsahee, @relyt29 and @magicxyyz am I understanding this right?
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.
yes that is exactly correct
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.
Okay. Thanks. I feel like we should put some abbreviated explanation of this reasoning in the inline documentation so that we remember why we're treating memory expansion gas as computation gas. Keep it brief, but, let's do explain 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.
I don't see the documentation for this. Did you decide not to add something?