retesteth icon indicating copy to clipboard operation
retesteth copied to clipboard

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

Open qbzzt opened this issue 4 years ago • 1 comments

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 avatar Mar 07 '21 02:03 qbzzt

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

qbzzt avatar Mar 28 '21 03:03 qbzzt