Closed hai-rise closed 1 week ago
@hai-rise Has anybody claimed this issue?
@byhashdong Not yet, but it's currently blocked by #358. I'll ping you when this is ready :pray:.
OK, Thanks a lot!
@byhashdong This is unblocked now :pray:.
@hai-rise I will take it.
@byhashdong Thank you!!
@hai-rise Can you help clarify why do we introduce the EVMCode
struct, but not reuse ByteCode
from revm
?
@byhashdong This was a hard decision but revm
types weren't optimal for pevm
. We need to make a fork to make it easier to implement pevm
and optimize several hot paths. Eventually, we decided on our types (EvmCode
included) for:
code
and code_hash
out of AccountBasic
(counterpart of AccountInfo
) so we don't need to duplicate codes in the MV memory.Storage::code_hash
and Storage::has_storage
.raw
bytecode in Bytecode::Eip7702
.Evm
thread-safe, to be pooled and shared among worker threads instead of expensive construction per transaction execution.revm
(with the cost of some runtime type conversions).For state-of-the-art performance, we'll likely need to:
revm
(so cannot upstream everything), or evmone
or JIT/AOH compiler, or And library users will only use pevm
and alloy
types to interface (for minimal conversions).
Nevertheless, we still provide a branch that uses revm
instead of our custom types for integration with existing revm
users like upstream Reth: https://github.com/risechain/pevm/pull/360/files.
TL;DR: It allows pevm
users to not pin and use our forked revm
types (which would clash if they were already using standard revm
somewhere), but to use Storage
, EvmAccount
, EvmCode
, etc.
Nice, Thanks for you clear explain @hai-rise
@hai-rise just submitted pr(#374), please feel free to have a review, thanks!
Done in #374.
Done in #374.
Thanks for your precise review.
https://github.com/risechain/pevm/blob/24266be8d317bdcbe8f8ac10c6ce34ae7298802d/src/storage.rs#L104