You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(vm-runner): Implement batch data prefetching (#2724)
## What ❔
- Implements prefetching of storage slots / bytecodes accessed by a VM
in a batch. Enables it for the VM playground. Optionally shadows
prefetched snapshot storage.
- Makes RocksDB cache optional for VM playground.
## Why ❔
- Prefetching will allow to load storage slots / bytecodes for a batch
in O(1) DB queries, which is very efficient for local debugging etc. It
may be on par or faster than using RocksDB cache. (There's a caveat:
prefetching doesn't work w/o protective reads.)
- Disabling RocksDB cache is useful for local testing, since the cache
won't catch up during a single batch run anyway.
## Checklist
- [x] PR title corresponds to the body of PR (we generate changelog
entries from PRs).
- [x] Tests for the changes have been added / updated.
- [x] Documentation comments have been added / updated.
- [x] Code has been formatted via `zk fmt` and `zk lint`.
/// [`ReadStorage`] implementation backed by 2 different backends:
23
-
/// source_storage -- backend that will return values for function calls and be the source of truth
24
-
/// to_check_storage -- secondary storage, which will verify it's own return values against source_storage
25
-
/// Note that if to_check_storage value is different than source value, execution continues and metrics/ logs are emitted.
24
+
/// [`ReadStorage`] implementation backed by 2 different backends which are compared for each performed operation.
25
+
///
26
+
/// - `Ref` is the backend that will return values for function calls and be the source of truth
27
+
/// - `Check` is the secondary storage, which will have its return values verified against `Ref`
28
+
///
29
+
/// If `Check` value is different from a value from `Ref`, storage behavior depends on the [panic on divergence](Self::set_panic_on_divergence()) flag.
30
+
/// If this flag is set (which it is by default), the storage panics; otherwise, execution continues and metrics / logs are emitted.
0 commit comments