-
Notifications
You must be signed in to change notification settings - Fork 83
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
feat: sload opcode #396
feat: sload opcode #396
Conversation
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.
beautiful PR! I like the layers of abstraction and the general direction
My main question is:
- do we need local and global changes in journal? My understanding is that having only global_changes is enough,
- we'd call finalize global changes at the end of each execution context (one storage syscall)
=> if the tx reverts, all sstores revert
=> if the tx does not revert, then writing directly from global_changes into storage multiple times at the same slot won't be charged in the L1 calldata, so it's merely a storage syscall cost tradeoff vs. maintaining 2 dicts instead of 1 and doing many dicts writes/accesses between each execution contexts
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.
can you add logic in machine.revert() to wipe the current local changes?
Update: after thinking about it for a while, I guess the debate between having local and global vs. only global can be summarized as:
Essentially in my challenge I wonder about the flow:
ERRATUM: this is not so good as in case of sub context reverting, we can't recover the past state of global_changes OKPM pour local + global We just need to implement what happens on revert -> clear keys but also overwrite local_changes dict by a fresh empty one |
Wouldn't it be for another PR ? I can add a todo |
fine with me |
lgtm |
bd75e57
to
d9e6d33
Compare
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.
lgtm
sload
opcodesload
pop_sba
stack method to convert a u256 stack value toStorageBaseAddress
upon retrievalpop_sba
Pull Request type
Please check the type of change your PR introduces:
What is the current behavior?
Resolves: #
What is the new behavior?
Does this introduce a breaking change?