Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
400d88f to
30b0891
Compare
c00bbff to
e03eb88
Compare
2e06fea to
6f1c89d
Compare
6a07315 to
ca714f0
Compare
| .dst_offset = dst_offset, | ||
| .member_enum = member_enum, | ||
| .space_id = memory.get_space_id(), | ||
| .timestamp = globals.timestamp, |
There was a problem hiding this comment.
is the timestamp the same for the whole TX? if yes I'm surprised you need it in all the places; you might be able to avoid it in most lookups (just thinking out loud, haven't checked)
There was a problem hiding this comment.
I moved it into only the update_check module and removed it from all of the interfaces. Update check now performs a lookup to the public inputs to retrieve timestamp. Removed it from TODOs in description!
There was a problem hiding this comment.
I'm a bit lost now. Where was the class id / derivation checked and is it being deduplicated?
Also: you mentioned in your doc that you'd make sure we are correctly deduplicating everything that we can (class id, bytecode hashing and decomposition etc). Can you confirm this is correct?
There was a problem hiding this comment.
Class ID derivation is only necessary during bytecode retrieval. So it is done by the Bytecode Manager. Address derivation is done any time you need to retrieve a contract instance, so it is triggered by Contract Instance Manager. During contract instance retrieval, we just need to validate the instance, so we don't care where the class ID comes from, just that it can be used to derive the provided address.
I don't think we are de-duplicating any of those to be honest! I was not planning on addressing that in this PR. I dove deeper into this for a while today and here is where I'm at:
- We can deduplicate bytecode hashing & class ID derivation by contract class ID as the unique identifier. I think this is easy in simulation and circuit.
- We can deduplicate address derivation by address. This is also easy in simulation and circuit.
- Update checking, nullifier checking, contract instance retrieval and bytecode retrieval will not be deduplicated.
- Bytecode ID is no longer deduplicating... anything. So if things like bytecode decomposition and instruction fetching were relying on deduplication there, that won't work anymore.
I'm happy to work on this, but I'm not sure how substantial an effort it will be. So I'm tempted to say we should treat it as a separate piece of work.
There was a problem hiding this comment.
Maybe it was actually easier than I thought. Take a look at this PR stacked on top. #15683
3229c30 to
985c7d2
Compare
2e4e394 to
03a4646
Compare
dcf75af to
0ce85f7
Compare

Design-ish document
update_checkalong with a new lookup to public inputs to constrain it.Important question:
Is it acceptable that the
GetContractInstanceopcode performs two permutations to memory to accomplish its two writes? I wish I discussed this with others sooner, but I didn't think enough about it. If that's not acceptable, our other options are:existsback to execution and let the execution trace handle the write from a register.Followup work: