Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(avm): ephemeral avm tree (#9798)
This adds forkable trees so that we can use them in the avm to handle context changes. The existing native trees are missing the ability to arbitrarily fork from uncommitted state. This is a requirement for our one-tx processing as we need to be able to fork-rollback-fork when encountering a change in the avm context (e.g. in a nested call). These trees store the difference between the initial tx state (stored in the native world state db) and the current ephmeral state during transaction processing. Queries are either handled by the ephemeral tree or proxied to the db. Currently there are definitely some room for performance improvements. Namely: - Storage of a sparse, value-sorted data structure for the indexed tree leaf updates. - This would allow for fast low nullifier lookup (which will be the bottleneck for indexed tree operations) - Copy-on-write when forking - Some nested calls may not perform any operations on the trees (or perhaps a subset of tree). Forking all the information may unnecessarily consume memory for deeper nested contexts.
- Loading branch information