Skip to content
This repository was archived by the owner on Mar 24, 2023. It is now read-only.
This repository was archived by the owner on Mar 24, 2023. It is now read-only.

[feat] Implement test and debug APIs to support ethereum/tests for state transitions #558

@e00dan

Description

@e00dan

Is your feature request related to a problem? Please describe.

Creating additional tests for Godwoken state transitions should be a priority. There is retesteth which runs ethereum/tests and can use TCP connection that it already leverages to test Besu client. However, Godwoken would need to implement additional RPC methods like Besu does.

Describe the solution you'd like

Implement RPC APIs listed in: https://ethereum-tests.readthedocs.io/en/latest/rpc-ref.html#the-rpc-interface similar to how Besu does it, eg. test_setChainParams. Besu implementation: https://github.com/hyperledger/besu/tree/451bb7a80c4f9ad32314a1e3116df514cc03f367/ethereum/retesteth/src/main/java/org/hyperledger/besu/ethereum/retesteth

Describe alternatives you've considered

Alternative is to write more tests natively for Godwoken and Polyjuice.

Additional context

Currently trying to run ethereum/tests against Godwoken Devnet fails:

$ ./retesteth -t GeneralStateTests -- --testpath "/home/kuzi/projects/tests" --clients godwoken

...

Error: Error on JSON-RPC call ( (stCallCodes/callcallcodecall_010_SuicideMiddle, step: GeneralStateTest)):
Request: '{"jsonrpc":"2.0","method":"test_setChainParams","params":[{
    "params" : {
        "homesteadForkBlock" : "0x00",
        "EIP150ForkBlock" : "0x00",
        "EIP158ForkBlock" : "0x00",
        "byzantiumForkBlock" : "0x00",
        "constantinopleForkBlock" : "0x00",
        "constantinopleFixForkBlock" : "0x00",
        "istanbulForkBlock" : "0x00",
        "berlinForkBlock" : "0x00",
        "chainID" : "0x01"
    },
    "accounts" : {
        "0x1000000000000000000000000000000000000000" : {
            "balance" : "0x0de0b6b3a7640000",
            "code" : "0x60406000604060006000731000000000000000000000000000000000000001620249f0f160005500",
            "nonce" : "0x00",
            "storage" : {
            }
        },
        "0x1000000000000000000000000000000000000001" : {
            "balance" : "0x02540be400",
            "code" : "0x60406000604060006000731000000000000000000000000000000000000002620186a0f260015500",
            "nonce" : "0x00",
            "storage" : {
            }
        },
        "0x1000000000000000000000000000000000000002" : {
            "balance" : "0x02540be400",
            "code" : "0x731000000000000000000000000000000000000000ff6040600060406000600073100000000000000000000000000000000000000361c350f160025500",
            "nonce" : "0x00",
            "storage" : {
            }
        },
        "0x1000000000000000000000000000000000000003" : {
            "balance" : "0x02540be400",
            "code" : "0x600160035500",
            "nonce" : "0x00",
            "storage" : {
            }
        },
        "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
            "balance" : "0x0de0b6b3a7640000",
            "code" : "0x",
            "nonce" : "0x00",
            "storage" : {
            }
        }
    },
    "sealEngine" : "NoReward",
    "genesis" : {
        "author" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
        "difficulty" : "0x020000",
        "gasLimit" : "0x01c9c380",
        "extraData" : "0x00",
        "timestamp" : "0x00",
        "nonce" : "0x0000000000000000",
        "mixHash" : "0x0000000000000000000000000000000000000000000000000000000000000000"
    }
}],"id":1}'
Result: 'Method not found'
 (stCallCodes/callcallcodecall_010_SuicideMiddle, step: GeneralStateTest)

--------
TestOutputHelper detected 1 errors during test execution!
/home/kuzi/projects/retesteth/retesteth/TestOutputHelper.cpp(226): error: in "GeneralStateTests/stCallCodes": 
Skipping stQuadraticComplexityTest because --all option is not specified.
Skipping stTimeConsuming because --all option is not specified.
Skipping stExpectSection because --filltests option is not specified.
Skipping vmPerformance because --all option is not specified.

*** 1 failure is detected in the test module "EthereumTests"

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions