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

Allow the expect: section to have information that is invisible to the evm #119

Open
qbzzt opened this issue Mar 7, 2021 · 1 comment
Open

Comments

@qbzzt
Copy link
Contributor

qbzzt commented Mar 7, 2021

At present the expect section only has accounts and their attributes (balance, nonce, code, and storage). This means we can only test results that are visible to the evm.

It would be useful to have additional information available, which retesteth gets (or can get) from t8ntool. Specifically, we could use visiblity into:

  1. Information from --vmtraceraw. For example, it might be useful to specify that when contract A is executed, when the program counter is B, the stack should have these values: [... , ... , ...], or that the gas spent between PC=x and PC=y is
    a certain amount.
  2. receipt.logs, the log entries emitted. Right now so the only way to check what they are is to write a blockchain test and look in the hash of the block where they are emitted to see it is the expected value (see https://github.com/ethereum/tests/blob/develop/src/BlockchainTestsFiller/ValidBlocks/bcStateTests/logRevertFiller.yml). This method is very susceptible to false positives, because any other change in the block also changes the hash.
  3. receipt.transactionHash, which lets us verify that everything ran as expected.
@qbzzt
Copy link
Contributor Author

qbzzt commented Mar 28, 2021

One requested feature was to have the logs entries available in a test (ethereum/tests#523). This would take care of that.

@qbzzt qbzzt changed the title Allow the except: section to have information that is invisible to the evm Allow the expect: section to have information that is invisible to the evm May 9, 2021
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

1 participant