rust-ethereum / evm

Pure Rust implementation of Ethereum Virtual Machine
Apache License 2.0
1.16k stars 355 forks source link

Feature Request: Separate 'In Memory' Module for External Import #251

Open jf-li00 opened 9 months ago

jf-li00 commented 9 months ago

I propose extracting the 'In Memory' functionality as a standalone module so other developer can import those data structures for their own purpose conveniently(e.g. write a simple custom simulator for EVM contracts)

sorpaas commented 9 months ago

The current "in memory" backend uses Clone for all substate layers, which is extremely inefficient -- that's why it's only in tests. I'm planning to add two proper in-memory backends in the future that uses a) journaling (where state commit is cheap) and b) overlay (where state revert is cheap).