eosnetworkfoundation / eos-evm-contract

EOS EVM
Other
22 stars 15 forks source link

Test replay of EOS EVM mainnet with contract built using updated silkworm #617

Closed arhag closed 1 year ago

arhag commented 1 year ago

Replay EOS mainnet using the new evm_runtime (the one built with latest silkworm version) and check if the contract state is the same as the one we currently have with version 0.5.0

elmato commented 1 year ago

Replayed mainnet from block 302534638 to 320583740 snapshot used: snapshot-2023-04-02-16-eos-v6-0302534637.bin

Same state hash for both contracts:

Old: state hash 4d6f1525163cdfd3b4b80384df2b64248907ef9dc9cb3623de50eb10c7b1fa88 eosio.evm 9b65b25561e945cbdf23d205b1d6fd9e713b31411ca600c74d814879b15c09ed

New: state hash 4d6f1525163cdfd3b4b80384df2b64248907ef9dc9cb3623de50eb10c7b1fa88 eosio.evm 10c38b04886e209b850d6b99188c6305ad1053b1546eb90774fe48a570b655a40

The only difference in the contract deployed with the one in the eos-evm PR was:

-    eosio::check(get_code() == token_account && quantity.symbol == token_symbol, "received unexpected token");
+    if(!(get_code() == token_account && quantity.symbol == token_symbol)) return;

To not raise an exception in case the contract receives a token different from EOS.

The snapshot tool to read the state of the contract https://github.com/elmato/leap/tree/snapshot-reader/programs/snapshot-reader

The version of nodes to swap the wasm of the contract https://github.com/elmato/leap/tree/v4.0.4-eosio-evm-hack