[go: up one dir, main page]

Duplicate mutable reference to runtime

What

Use Arc<Mutex<_>> for multiple ownership of the mutable reference to runtime that the kernel entry function provides.

Why

Implementing the Database trait for revm requires ownership (of a mutable reference at least) the interface to kernel storage

How

By cloning the Arc<Mutex>, for the evm runner, and using the original for debug messages

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 100.017 TPS 7951.383 TPS
13th Gen Intel(R) Core(TM) i7-13700HX 139.252 TPS 9042.070 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/riscv
    • dune build src/lib_riscv
    • dune 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.

Merge request reports

Loading