CODECOPY opcode#391
Conversation
86e444d to
2ff75d3
Compare
|
@han0110 In the specs lookup implementation here, we check if there's one and only one match and return it. But it does allow optional fields. How can this be done in the Rust impl? As I see it, this would have to be changed to: Self::Bytecode {
hash,
tag,
index,
opt_is_code,
value,
} => {
if let Some(is_code) = opt_is_code {
vec![hash.clone(), tag.clone(), index.clone(), value.clone(), is_code.clone()]
} else {
vec![hash.clone(), tag.clone(), index.clone(), value.clone()]
}
}Also the layout of bytecode table will have to be modified so that |
|
In spec we try not to annoying developer to provide all of witness to pass a verification, so lookup is made to be like a normal map lookup, then we can use partial value to get the full row. But in circuit, we have to provide all, so current approach makes sense me. I think we can stick to this now, because there is another idea that can help to make all of these more sense. (see here https://hackmd.io/Pmd8xoZWRVmko8LkRNhABQ) |
3fcc49f to
197d289
Compare
|
Bus-mapping PR added here: scroll-tech#123 |
559bd62 to
5b5a686
Compare
5b5a686 to
ecdaf2e
Compare
|
Sorry @roynalnaruto for the delay, I'll help review this too. |
dfee76c to
75232e7
Compare
han0110
left a comment
There was a problem hiding this comment.
Only got some nitpicks, others look good to me.
ChihChengLiang
left a comment
There was a problem hiding this comment.
LGTM modulo other review comments.
@han0110 It's already in progress here: scroll-tech#123. Once I'm done with the internal call cases for calldataload and calldatacopy (bus-mapping), I will wrap this up. |
04aac84 to
a326290
Compare
I've made the change where |
|
Thanks for the contribution @roynalnaruto |
Specs PR: privacy-ethereum/zkevm-specs#148
TODOs:
Lengthrow per bytecode (as per CODECOPY opcode zkevm-specs#148)CodeSizeto be fetched from the bytecode circuit