Revm uses the kernel durable storage
What
A database is required by revm to store the execution context. Replace the provided in memory database with a custom database which uses the kernel's durable storage.
Why
It's unrealistic for any computer to have enough memory to run etherlink. So we introduce usage of durable storage to more faithfully reproduce etherlink's behaviour
How
Revm provides the Database trait for reading various info and the DatabaseCommit trait for writing info. These are implemented, following the expected semantics which was inferred from how the in-memory db of revm is implemented. Some simplifications could be made for our case such as removing the AccountState flags. Some abstractions on top of the interface provided by the Runtime from tezos_smart_rollup, to make querying paths and writing unlimited data cleaner.
Manually Testing
From the riscv/revm run make build. Then from riscv/scripts run ./revm-bench -t 100 or ./revm-bench -t 10000 -sn
As a quick check there should be no runtime errors when running make run-revm from the riscv directory
Benchmarking
| riscv | native | |
|---|---|---|
| Benchmark Machine | 99.038 TPS | 7875.793 TPS |
| 13th Gen Intel(R) Core(TM) i7-13700HX | 144.555 TPS | 9258.934 TPS |
Tasks for the Author
-
Link all Linear issues related to this MR using magic words (e.g. part of, relates to, closes). -
Eliminate dead code and other spurious artefacts introduced in your changes. -
Document new public functions, methods and types. -
Make sure the documentation for updated functions, methods, and types is correct. -
Add tests for bugs that have been fixed. -
Put in reasonable effort to ensure that CI will pass. make -C src/riscvdune build src/lib_riscvdune build src/rust_deps
-
Benchmark performance and populate the table above if needed. -
Explain changes to regression test captures when applicable. -
Write commit messages to reflect the changes they're about. -
Self-review your changes to ensure they are high-quality. -
Complete all of the above before assigning this MR to reviewers.