darwinia-network / collaboration

Collaboration Initiatives
MIT License
7 stars 31 forks source link

Add RFP: Solution/Tool for migrate Frontier EVM storage to revm/Geth data db #53

Open hackfisher opened 5 months ago

hackfisher commented 5 months ago

Darwinia EVM+ is currently adopting Frontier, the substrate version of EVM implementation, to support EVM, the storage complies with Substrate storage as following:

https://github.com/polkadot-evm/frontier/blob/c6a962fad3fcdfab9b0749ce1747badfa2a4493c/frame/evm/src/lib.rs#L567-L579

    #[pallet::storage]
    pub type AccountCodes<T: Config> = StorageMap<_, Blake2_128Concat, H160, Vec<u8>, ValueQuery>;

    #[pallet::storage]
    pub type AccountCodesMetadata<T: Config> =
        StorageMap<_, Blake2_128Concat, H160, CodeMetadata, OptionQuery>;

    #[pallet::storage]
    pub type AccountStorages<T: Config> =
        StorageDoubleMap<_, Blake2_128Concat, H160, Blake2_128Concat, H256, H256, ValueQuery>;

    #[pallet::storage]
    pub type Suicided<T: Config> = StorageMap<_, Blake2_128Concat, H160, (), OptionQuery>;

But current the ecosystem is lacking solution and tools for process or migrate from the Frontier/Substrate db to generate the genesis data for producing blocks as L2 Rollup. It would be great if there would be such solutions or tools for doing it.

Ref:

https://medium.com/darwinianetwork/unlocking-cross-chain-potential-darwinia-communitys-pioneering-build-op-stack-layer2-with-bf1d58a9e272

hackfisher commented 3 months ago

Keep chain state and chain history, chain id, run from new client continuing the block height.