SLOAD/SSTORE opcodes#85
Conversation
b4162cb to
2ca8a04
Compare
|
Thanks for exploring this! BTW there is another WIP PR for Let me try to answer the questions:
Yes, we maintain everything random accessible data in Also currently we assume we would be able to verify multiple transactions in a proof, so the tuple will be like
Yes, every access record from
Yes, we get
I don't think we need, because value on stack and storage in |
|
I am also working on this (but happy to have more people to work together&discuss), and have had a few discussions with @han0110, so may be able to answer a bit here. here's my attempt: scroll-tech#11
yes. and this will affect the gas calculation. I think currently at this stage we could just assume it will be provided in the lookup and no need to calc by ourselves (like in begin_tx.py)?
we need to look it up in access_list, and mark it after operations.
yes. we only need 1 lookup, for 1 word. BTW, as pointed out by @han0110, we need to deal with state revert in |
| return self.data[key] | ||
| return 0 | ||
|
|
||
| def write(self, key, value): |
There was a problem hiding this comment.
we could just use type annotation
def write(self, key: U256, value: U256):
so that we don;t need these asserts?
| key8s: Sequence[U8], | ||
| new_value8s: Sequence[U8], | ||
| original_value8s: Sequence[U8], | ||
| current_value8s: Sequence[U8], |
There was a problem hiding this comment.
you mention in the markdown spec that you use 1 word instead of 32bytes. (and you are right about that).
I think there's no need to convert U256 to and from [U8], which seems redundant.
|
Thanks both for the answers/comments/reviews! Ah ok, wasn't aware of the other repo. For info, what's the difference between the two spec repos? Agree with all the comments. Please feel free to close this PR! We can continue the discussion on the other PR, if needed. |
|
Ah, I thought only @barryWhiteHat Do you think we should remove features of access list EIPs (can do quickly) and add them back in the future, or should we go with |
|
Yeah i think EIP2929 should be okay. IIUC its just reprice for some opocdes and that also gets applied to legacy txs. |
btw should I wait for #78? |
No, I think scroll-tech#11 can go without that. |
|
I noticed that #106 was recently merged which added the SLOAD and SSTORE opcode specs, and thus superseded this PR. Sot seems there will be no further progress with this PR; maybe we can close it? |
|
Yep! |
@barryWhiteHat suggested I worked on this, so here's my attempt. I used the MLOAD/MSTORE specs as base, and I'm not sure about several things in this spec cus I don't know a lot about that stuff in general, especially in the circuit and constraints sections.
I'll start working on the Rust zkevm-circuit side of this once this spec is stable.
Here are my questions for this spec:
(context_address, key). Currently I just used a Boolean flagis_touched, which I guess would somehow come from the busmapping? Would we need two versions of that flag here, one pre and one post update?Happy to get any direction on those items and fix them!