privacy-scaling-explorations / zkevm-specs

334 stars 272 forks source link

MCOPY spec #522

Open curryrasul opened 6 months ago

curryrasul commented 6 months ago

Issue Link

Closes #510

curryrasul commented 6 months ago

It's not directly related to MCOPY, but I'm working on this, and looking through RETURNDATACOPY, which we discussed before @ChihChengLiang It is said, that RETURNDATACOPY copies from memory to memory: https://github.com/privacy-scaling-explorations/zkevm-specs/blob/4f272c2b6ddfaf2b0815d1b93a6b32e38f5d8fb8/specs/tables.md?plain=1#L276-L279

I read about RETURNDATACOPY, it's said that it copies from so-called return data buffer, that acts like a temporary place, where's the return value from contract-call is stored. Is it still memory? Or maybe it doesn't belong to memory , stack or storage?

zemse commented 6 months ago

I read about RETURNDATACOPY, it's said that it copies from so-called return data buffer, that acts like a temporary place, where's the return value from contract-call is stored. Is it still memory? Or maybe it doesn't belong to memory , stack or storage?

I was confused about returndata not present in CopyDataType, but it seems returndatacopy copies from the memory of child call's memory to the current call's memory. So this memory to memory copy of returndatacopy makes sense to me now and mcopy is pretty much similar apart from it is a memory to memory copy for the same call.