kwannoel / urban-octo-carnival

DRAFT REPO: trying out gitlab -> github
Apache License 2.0
1 stars 0 forks source link

Make state digest's storage address a function of contract inputs #186

Open kwannoel opened 3 years ago

kwannoel commented 3 years ago

In GitLab by @isd on May 23, 2021, 05:55

As part of #157, we need to store addresses of merkelized states for different interactions at different addresses. So, instead of storing at a constant 0 address, we can store at an address that is the hash of relevant inputs, which will include at least:

cc: @alex413

kwannoel commented 3 years ago

In GitLab by @ApolloUnicorn on May 26, 2021, 23:25

assigned to @alex413

kwannoel commented 3 years ago

In GitLab by @ApolloUnicorn on May 26, 2021, 23:25

@alex413 to prepare paperwork for this item

kwannoel commented 3 years ago

In GitLab by @isd on May 29, 2021, 08:27

@fahree has asked me to switch over to some more urgent tasks, so doing a brain dump here for whenever I/we get back to this:

The first thing that needs to happen is we need to tease apart variables which are the same for all interactions of a given contract from ones that are different per-contract -- it's not coherent to talk about the initial state of the contract without doing this. So I left of figuring what the the best way to separate these is. I wish we had some notion of sections in our executable/address space. But my rough sense is we want to go to a solution where all of the variables which are different across interactions appear after all of the other variables, so we can easily hash just the stuff that's the same. Then, we can hash the full initial state to get the storage location for the current state digest, but we can also when starting an interaction compute the hash of just the common bits, to ensure that they're right.

If we do it this way, we can also store the state digest xor'd with the initial state digest, so that the zeros that are in there by default correctly represent contracts in their initial state.