ethereum / tests

Common tests for all Ethereum implementations
MIT License
560 stars 319 forks source link

Update tests because of EIP7610 #1368

Closed rjl493456442 closed 6 months ago

rjl493456442 commented 6 months ago

EIP7610 has been merged https://github.com/ethereum/EIPs/pull/8161, while there are some tests are outdated because of it.


stSStoreTest/InitCollision.json

It tests a scenario that: account already has storage X. create -> in init code change that account's storage -> 0 -> change it to X again. As the contract deployment will be rejected if the destination has non-empty storage, therefore, this test should be removed or updated.

stRevertTest/RevertInCreateInInit.json, stCreate2/RevertInCreateInInitCreate2

This test involves a scenario that the destination of contract deployment has non-empty storage. According to EIP7610, the whole deployment should be rejected. This test should be removed.

stCreate2/create2collisionStorage

It tests a scenario that: create2 generates an account that already exists and has storage != 0. This test should be removed or updated.

stExtCodeHash/dynamicAccountOverwriteEmpty

It tests a scenario that: EXTCODEHASH of empty account, then CREATE or CREATE2 over it, EXTCODEHASH again. This should check that code hash cache is correctly updated during the transaction.

Unfortunately, the target of EXTCODEHASH has a non-empty storage and it's not eligible for re-deployment. This test should be updated.

chfast commented 6 months ago

@rjl493456442 the EIP has been merged but it is still a draft. You should update its status.

chfast commented 6 months ago

Tests which are failing for me:

[  FAILED  ] stCreate2.RevertInCreateInInitCreate2
[  FAILED  ] stCreate2.RevertInCreateInInitCreate2Paris
[  FAILED  ] stCreate2.create2collisionStorage
[  FAILED  ] stCreate2.create2collisionStorageParis
[  FAILED  ] stExtCodeHash.dynamicAccountOverwriteEmpty
[  FAILED  ] stExtCodeHash.dynamicAccountOverwriteEmpty_Paris
[  FAILED  ] stRevertTest.RevertInCreateInInit
[  FAILED  ] stRevertTest.RevertInCreateInInit_Paris
[  FAILED  ] stSStoreTest.InitCollision
[  FAILED  ] stSStoreTest.InitCollisionParis

and legacy tests:

[  FAILED  ] stCreate2.RevertInCreateInInitCreate2
[  FAILED  ] stCreate2.create2collisionStorage
[  FAILED  ] stExtCodeHash.dynamicAccountOverwriteEmpty
[  FAILED  ] stRevertTest.RevertInCreateInInit
[  FAILED  ] stSStoreTest.InitCollision
winsvega commented 6 months ago

Here is the new geth version of this tests https://github.com/ethereum/tests/pull/1367

Will have to fix the legacy tests. too

chfast commented 6 months ago

Here is the new geth version of this tests #1367

After applying the EIP-7610 in evmone I pass the tests mentioned in this issue. But I started failing these:

[  FAILED  ] stEIP2930.manualCreate
[  FAILED  ] stEIP2930.variedContext
winsvega commented 6 months ago

That tests measure gasprice on tx create

https://github.com/ethereum/tests/blob/develop/src/GeneralStateTestsFiller/stEIP2930/manualCreateFiller.yml

winsvega commented 6 months ago

Also you can have a vmtrace here

http://retesteth.ethdevops.io/web/index.php?gtests=stEIP2930&singletest=manualCreate&clients=t8ntool&snetwork=Shanghai&vmtrace=vmtrace&verbosity=none&trd=&trg=&trv=

winsvega commented 6 months ago

https://github.com/ethereum/tests/pull/1367

chfast commented 6 months ago

That tests measure gasprice on tx create

https://github.com/ethereum/tests/blob/develop/src/GeneralStateTestsFiller/stEIP2930/manualCreateFiller.yml

It uses an access list so it messes up with the storage... I guess you need to review this and make sure this is properly tested.

rjl493456442 commented 6 months ago

@rjl493456442 the EIP has been merged but it is still a draft. You should update its status.

Will do!