zkevm-circuits
zkevm-circuits copied to clipboard
discussion: how to reconstruct memory for precompiles?
Previously we remove memory in geth trace since tracing memory can easily result gigabytes of trace json and even hang geth.
But there is one piece still missing: precompile. We did memory reconstruction for all opcodes but did not handle with precompiles.
I am considering two solutions:
(1) re-compute precompile results locally using crates like https://docs.rs/pallet-evm/latest/pallet_evm/trait.Precompile.html (in fact we already tested with this crate and it works well)
(2) use trace_call rpc to fetch return value of calls(of course including precompile contracts). It may be better for future in case we need some extra information provided by trace_call
any preference?
I think @ashWhiteHat started the work on the first pre-compile. He's working on the specs now, but could be nice to also check this.
Important questions:
- Will we have type conversion issues? (ie. implementing 1000 type conversions between pallet_evm and our repos types).
- Does the pre-compile memory re-computation process actually return all the things we need? Will we need extra tricks? And if so, it's better to avoid having more depencencies and continue via the
trace_callway. Where we're already quite experienced :slightly_smiling_face: