telosnetwork / telos-reth

Modular, contributor-friendly and blazing-fast implementation of the Ethereum protocol, in Rust
Apache License 2.0
2 stars 0 forks source link

Add two state-effective wrong functionality of TelosEVM contract to revm #11

Closed aamirpashaa closed 3 months ago

aamirpashaa commented 8 months ago

Describe the feature

There are two state-effective bugs that we have found until now on the Telos EVM contract:

  1. get_account bug (Fixed here: #95)
  2. wrong DELEGATECALL value (Fixed here: #101)

To support historical calls, we should modify the revm to behave exactly like the problematic version of the Telos EVM contract when calling against historical blocks. The revm functionality will be normal for post-upgrade blocks and this will be determined by checking the revision number changes passed to the reth through Engine API functions.

Additional context

No response

aamirpashaa commented 7 months ago

We are facing some differences in the account table (which holds the addresses, their nonces and balances, and codes) between the reth and Telos EVM contracts. Some of the differences are expected, like address creation using openwallet and create action in the EVM contract which inserts a new row inside the account table, but they are not added to reth until they are involved in a transaction. but we don't expect a difference for addresses that have non-zero balances:

Screenshot 2024-03-21 015342

And it can have 2 reasons: 1) We haven't correctly implemented our 2 state-effective bugs inside revm 2) There are other bugs that we are not aware of

And I'm investigating the reason now