Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check behaviour of ethereum/tests for expected exception #730

Closed
rakita opened this issue Sep 18, 2023 · 4 comments
Closed

Check behaviour of ethereum/tests for expected exception #730

rakita opened this issue Sep 18, 2023 · 4 comments

Comments

@rakita
Copy link
Member

rakita commented Sep 18, 2023

When a field is present we currently have different state root than it is set in test:

ethtests/EIPTests/StateTests/stEIP1153-transientStorage/ ethtests/EIPTests/StateTests/stEIP4844-blobtransactions/ ethtests/EIPTests/StateTests/stEIP5656-MCOPY/`

Running tests in ethtests/GeneralStateTests/...
Test "NoSrcAccount" (id: 0, path: ethtests/GeneralStateTests/stTransactionTest/NoSrcAccount.json) failed:
Test NoSrcAccount failed: state root mismatch: expected 0xa511d2fb090b111e2a9e1459c648060322ebb545c0a89a8edf5cebf11e4f1eb2, got 0x25298cb0779d10a5f411af0693043af3998891d7ee557d7fed4005b5e7ed690a

Traces:

Execution result: Err(
    Transaction(
        LackOfFundForMaxFee {
            fee: 21000,
            balance: 0x0_U256,
        },
    ),
)

Expected exception: Some("TR_NoFunds")

State before: CacheState {
    accounts: {
        0xd0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0: CacheAccount {
            account: Some(
                PlainAccount {
                    info: AccountInfo {
                        balance: 0x0_U256,
                        nonce: 0,
                        code_hash: 0xbc36789e7a1e2814364642[298](https://github.com/bluealloy/revm/actions/runs/6221586197/job/16883843074#step:6:299)28f817d6612f7b477d66591ff96a9e064bcc98a,
                        code: Some(
                            Bytecode {
                                bytecode: "00",
                                state: Raw,
                            },
                        ),
                    },
                    storage: {},
                },
            ),
            status: Loaded,
        },
    },
    contracts: {},
    has_state_clear: false,
}

State after: CacheState {
    accounts: {
        0xd0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0: CacheAccount {
            account: Some(
                PlainAccount {
                    info: AccountInfo {
                        balance: 0x0_U256,
                        nonce: 0,
                        code_hash: 0xbc36789e7a1e281436464229828f817d6612f7b477d66591ff96a9e064bcc98a,
                        code: Some(
                            Bytecode {
                                bytecode: "00",
                                state: Raw,
                            },
                        ),
                    },
                    storage: {},
                },
            ),
            status: Loaded,
        },
        0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b: CacheAccount {
            account: None,
            status: LoadedNotExisting,
        },
    },
    contracts: {},
    has_state_clear: false,
}

Environment: Env {
    cfg: CfgEnv {
        chain_id: 1,
        spec_id: FRONTIER,
        kzg_settings: Default,
        perf_analyse_created_bytecodes: Analyse,
        limit_contract_code_size: None,
        disable_coinbase_tip: false,
    },
    block: BlockEnv {
        number: 0x0000000000000000000000000000000000000000000000000000000000000001_U256,
        coinbase: 0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba,
        timestamp: 0x00000000000000000000000000000000000000000000000000000000000003e8_U256,
        gas_limit: 0x0000000000000000000000000000000000000000000000000000000005500000_U256,
        basefee: 0x000000000000000000000000000000000000000000000000000000000000000a_U256,
        difficulty: 0x0000000000000000000000000000000000000000000000000000000000020000_U256,
        prevrandao: Some(
            0x0000000000000000000000000000000000000000000000000000000000020000,
        ),
        excess_blob_gas: Some(
            0,
        ),
    },
    tx: TxEnv {
        caller: 0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b,
        gas_limit: 21000,
        gas_price: 0x0000000000000000000000000000000000000000000000000000000000000064_U256,
        transact_to: Call(
            0xd0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0,
        ),
        value: 0x0_U256,
        data: b"",
        nonce: None,
        chain_id: None,
        access_list: [],
        gas_priority_fee: None,
        blob_hashes: [],
        max_fee_per_blob_gas: None,
    },
}
Finished execution. Total CPU time: 21.835605s
Error: Statetest(TestError { name: "NoSrcAccount", kind: StateRootMismatch { got: 0x25298cb0779d10a5f411af069[304](https://github.com/bluealloy/revm/actions/runs/6221586197/job/16883843074#step:6:305)3af3998891d7ee557d7fed4005b5e7ed690a, expected: 0xa511d2fb090b111e2a9e1459c648060[322](https://github.com/bluealloy/revm/actions/runs/6221586197/job/16883843074#step:6:323)ebb545c0a89a8edf5cebf11e4f1eb2 } })

This is firstly notices inside eip4844, but it fails here for mcopy.

@thedevbirb
Copy link
Contributor

I can take a look at it. Sorry for the q, but what do you mean with "When a field is present..."? Where?

@rakita
Copy link
Member Author

rakita commented Sep 19, 2023

I can take a look at it. Sorry for the q, but what do you mean with "When a field is present..."? Where?

This guy: https://github.com/bluealloy/revm/blob/main/bins/revme/src/statetest/models/mod.rs#L31

This test is nice to look:
blobhashListBounds7 is very simple and has an exception but it fails:
https://github.com/ethereum/tests/blob/661356317ac6df52208d54187e692472a25a01f8/EIPTests/StateTests/stEIP4844-blobtransactions/blobhashListBounds7.json#L30

While a very similar test does not and it passes:
https://github.com/ethereum/tests/blob/develop/EIPTests/StateTests/stEIP4844-blobtransactions/blobhashListBounds6.json

@thedevbirb
Copy link
Contributor

Is this fixed with the latest PRs? #735

@rakita
Copy link
Member Author

rakita commented Sep 20, 2023

Is this fixed with the latest PRs? #735

Sorry about this it is fixed here #734, but there were some additional checks on eip4844 that fixed other tests #735. Initially, I thought they are connected

@rakita rakita closed this as completed Sep 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants