Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

abstract over state _and_ storage tries #707

Open
0xaatif opened this issue Oct 7, 2024 · 0 comments · May be fixed by #732
Open

abstract over state _and_ storage tries #707

0xaatif opened this issue Oct 7, 2024 · 0 comments · May be fixed by #732

Comments

@0xaatif
Copy link
Contributor

0xaatif commented Oct 7, 2024

@Nashtare
@hratoanina
I think I've missed something about SMT support.
It looks like SMTs care about all writes to the account's storage:

for (slot, value) in storage {
trie.set(key_storage(addr, slot), value);
}

I designed trait StateTrie on the assumption that there was a struct that held AccountRlp (or something like it).
My understanding was that storages were out-of-band (BTreeMap<H256, TypedMpt> is sprinkled around the place).
For SMT support, do we care about updating the storage inside the smt?
If so, there will have to be another trait around storage handling, and probably a chunk of design work.

- @0xaatif in Slack

Indeed, you do care about individual storage cells. In the SMT format, the state trie doesn't store an account at a single place, but stores the nonce, the balance, the code hash, the code length and every individual (non-zero) storage cell value at different locations.

- @hratoanina in Slack

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Backlog
Development

Successfully merging a pull request may close this issue.

1 participant