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

[merkledb] Prefetch Missing Trie Nodes Not Found in Cache #491

Open
patrick-ogrady opened this issue Sep 22, 2023 · 7 comments · May be fixed by #549
Open

[merkledb] Prefetch Missing Trie Nodes Not Found in Cache #491

patrick-ogrady opened this issue Sep 22, 2023 · 7 comments · May be fixed by #549
Assignees
Labels
enhancement New feature or request

Comments

@patrick-ogrady
Copy link
Contributor

This may allow us to use more disk bandwidth rather than more memory (which may be a good balance for some networks).

The EVM supports this by pre-executing all txs on the parent state.

@patrick-ogrady patrick-ogrady added the enhancement New feature or request label Sep 22, 2023
@patrick-ogrady
Copy link
Contributor Author

patrick-ogrady commented Sep 22, 2023

This could be done when marking that a key has been modified (we could async check all intermediate nodes are present).

We wouldn't necessarily need to do this on the read path because we would just be reading values directly.

@patrick-ogrady
Copy link
Contributor Author

According to @dboehm-avalabs, this can be accomplished using logic already implemented in "GetProof".

@patrick-ogrady
Copy link
Contributor Author

We should stop prefetching paths as soon as we are done executing txs (as we will already fetch in root gen) to avoid duplicate fetches?

@patrick-ogrady patrick-ogrady added this to the v0.0.16 (Private Devnet Optimizations) milestone Oct 12, 2023
@patrick-ogrady patrick-ogrady self-assigned this Oct 12, 2023
@patrick-ogrady patrick-ogrady linked a pull request Oct 12, 2023 that will close this issue
3 tasks
@patrick-ogrady
Copy link
Contributor Author

If we split trie node cache vs value cache, this should make it much faster. Right now, lock contention on trie path prefetch (specifically the node cache) slows things down.

@dboehm-avalabs
Copy link
Contributor

Playing with some improvements in https://github.com/ava-labs/avalanchego/tree/NodeReduction that could help with this.

@patrick-ogrady patrick-ogrady removed this from the v0.0.16 (Improvements from Devnet Experiments) milestone Nov 9, 2023
@patrick-ogrady
Copy link
Contributor Author

With Coaxium, this could be made even more aggressive and we could populate the cache for intermediate nodes before execution even starts (we just wouldn't know which are modified).

@patrick-ogrady
Copy link
Contributor Author

Example implementation: ava-labs/coreth#372

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Researching 📚
Development

Successfully merging a pull request may close this issue.

2 participants