Giter Site home page Giter Site logo

tests's Introduction

Ethereum Execution Tests (EVM) Build Status

Common tests for all clients to test against. Test execution tool: https://github.com/ethereum/retesteth

Test Formats

Maintained tests:

/BasicTests
/BlockchainTests
/GeneralStateTests
/TransactionTests
/EIPTests
/EOFTests
/RLPTest
/src

See descriptions of the different test formats in the official documentation at http://ethereum-tests.readthedocs.io/.

Note:
The format of BlockchainTests recently changed with the introduction of a new field sealEngine (values: NoProof | Ethash), see related JSON Schema change or BlockchainTest format docs for reference.

This means that you can skip PoW validation for NoProof tests but also has the consequence that it is not possible to rely on/check PoW related block parameters for these tests any more.

Clients using the library

The following clients make use of the tests from this library. You can use these implementations for inspiration on how to integrate. If your client is missing, please submit a PR (requirement: at least some minimal test documentation)!

Using the Tests

We do versioned tag releases for tests and you should aim to run your client libraries against the latest repository snapshot tagged.

Generally the develop branch in ethereum/tests is always meant to be stable and you should be able to run your test against.

Contribute to the Test Suite

See the dedicated section in the docs on how to write new tests. Or read a shorter description here.

If you want to follow up with current tasks and what is currently in the works, have a look at the issues

Currently the geth evm t8ntool client is the reference client for generating tests. Besu client also has support for generating the tests using rpc test protocol. See at https://github.com/ethereum/retesteth/wiki

Testing stats

Testing results are available at http://retesteth.ethdevops.io/
There is a web tool for vmtracing the tests using supported clients and retesteth: http://retesteth.ethdevops.io/web/
All blockchain tests are being run by hive tool: https://hivetests.ethdevops.io/

Contents of this repository

Do not change test files in folders:

  • StateTests
  • BlockchainTests
  • TransactionTests
  • VMTests

It is being created by the testFillers which could be found at src folder. The filler specification and wiki are in development so please ask on gitter channel for more details.

If you want to modify a test filler or add a new test please contact @wdimitry at telegram Use the following guide: https://github.com/ethereum/retesteth/wiki/Creating-a-State-Test-with-retesteth

tests's People

Contributors

ajsutton avatar alexknauth avatar ayrat555 avatar cdetrio avatar chfast avatar cjentzsch avatar ethers avatar gavofyork avatar gumb0 avatar heikoheiko avatar holgerd77 avatar holiman avatar hugo-dc avatar iaroslavmazur avatar jwasinger avatar maaktweluit avatar marcuswentz avatar marioevz avatar mariusvanderwijden avatar matkt avatar obscuren avatar pdobacz avatar pirapira avatar qbzzt avatar romanman avatar shemnon avatar sr9000 avatar vbuterin avatar wanderer avatar winsvega avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tests's Issues

Callecrecover2 and C++ tracing

AZ version 6fa0cbf

http://pastebin.com/XwFbXpeP is the C++ trace

here is snippet
*** 095e7baea6a6c7c4c2dfeb977efac326af552d87: 20100000 (+100000)

  • 0000000000000000000000000000000000000000000000000000000000000000: E5266519F86DBF1BAC6021C6BA9711B43AC8561C
    

#1: The test json for post of 095e7 should have a value stored at location 0 ?
#2: I am not sure if E5266519F86DBF1BAC6021C6BA9711B43AC8561C is the correct value that should be stored. In JS the value we have is zero, so that deletes what is stored in location 0 and our test passes.

Maybe the tracing is what's wrong?

invalid tx tests

some of the tx tests are invalid
Here the signatures are the wrong length, so there is no way for this to be a valid tx.

Also RLPElementsWithZeros isn't working out for me. Would love it if some one could double check that

Code is defined in both pre and exec

For many of the tests, I found code to be present in the pre-definition of the contract and in the exec-part of the test. This seems to be redundant. Is there a reason for this?

Incorrect expected gas remaining values

Some tests were made under the assumption that a stack-underflow still costs gas.
This results in incorrect post-values.

The following tests have been identified so far

vmIOandFlowOperationsTest.json

pop1         expected: [9999], actual: [10000]

vmPushDupSwapTest.json

swap2error   expected: [9997], actual: [9998]
dup2error    expected: [9998], actual: [9999]

201410211657.json

expected: [9974], actual: [9976]

201410211701.json

expected: [9999], actual: [10000]

201410211704.json

expected: [9999], actual: [10000]

201410211707.json

expected: [9999], actual: [10000]

201410211709.json

expected: [9999], actual: [10000]

201410211717.json

empty file

201410211719.json

expected: [9999], actual: [10000]

201410211722.json

expected: [9999], actual: [10000]

refund_CallA

In the trace for this test, it seems there is no output relating to how the ending balances ended up in that state:

Java

 06:02:27.126 [VM]  
 Spent Gas: [830]/[1500]
   Left Gas:  [670]

Cpp

EVM [ 07:03:08 | main | 0 | 095e7baea6a6c7c4c2dfeb977efac326af552d87 | #10 |
 0026 : STOP | 670 | -0 | 0x32 ]

And yet, even with the spent gas at 830, the testcase says:

Post:

  "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
  "balance" : "730",
     "code" : "0x",
     "nonce" : "0",
     "storage" : {
    }

Is this right?

stSystemOperationsTest.json createNameRegistratorValueTooHigh -- problem

I think that exception should not happen.

root@ip-10-167-187-237:~/cpp-poc-7/cpp-ethereum/build/test# ./testeth --log_level=test_suite --run_test=StateTests/userDefinedFileState --statetest /root/cpp-poc-7/tests/StateTests/stSystemOperationsTest.json createNameRegistratorValueTooHigh
Running 1 test case...
Entering test suite "EthereumTests"
Entering test suite "StateTests"
Entering test case "userDefinedFileState"
*** [ 08:18:49 | main ] Testing user defined test: /root/cpp-poc-7/tests/StateTests/stSystemOperationsTest.json
createNameRegistratorValueTooHigh
*** [ 08:18:50 | main ] state execution did throw an exception: /root/cpp-poc-7/cpp-ethereum/libethereum/Executive.cpp(77): Throw in function bool dev::eth::Executive::setup(dev::bytesConstRef)
Dynamic exception type: boost::exception_detail::clone_impl<dev::eth::NotEnoughCash>
std::exception::what: std::exception
[dev::tag_required*] = 110000
[dev::tag_got*] = 1000

Leaving test case "userDefinedFileState"; testing time: 292969mks
Leaving test suite "StateTests"
Leaving test suite "EthereumTests"

F2 - interpreted as RETURN

the context is TransactionContractCreation in this test suite:
https://github.com/ethereum/tests/blob/develop/StateTests/stInitCodeTest.json

here is the log of the execution:
https://gist.github.com/romanman/bdfb109eb56a2cb456d7

the last op in the run is PUSH1 and than to finish the run it looks like
RETURN been called, but if we look closely on the transaction
data 0x600a80600c6000396000 [f2] 00600160008035811a8100 the
F2 should be called and that F2 is not a RETURN anymore since
last change. Well still can be the case that I am missing
something, but will be happy for help anyway @CJentzsch

P.S. also TransactionCreateSuicideContract has F2 as expected RETURN

Thanks
Roman

Merge develop into master for PoC 6 conservation

The tests in develop are valid for PoC 6.
I want to commit new tests for PoC 7. My suggestion would be to merge the develop branch with master, and commit PoC 7 tests to develop. Alternatively we can have a PoC 6 and PoC 7 branch.

[vmArithmeticTest exp1] gas calculation problem

so im having a problem a with gas calculation on the exp1 test. From the yellow paper gas cost is
Gexp + Gexpbyte * (1 + floor(log256(exponent)));
The exponent in the exp1 test is fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe. With Gexp and Gexpbyte set to 10 the cost works out to be 340. CPP is giving 330. So I wonder if there is a rounding error somewhere. log256(exponent) === 32 for me. Is this the same for CPP?

also related is my stack trace https://gist.github.com/wanderer/fd3a6922bf5588d5722e

Balance Overflows

should this be 115792089237316195423570985008687907853269984665640564039457584007913129640035 ?
I See that the balance is overflowing but is this correct behavior?

Some incorrect post-repo values

Issue with post repository on these tests:

bcInvalidHeaderTest.json
wrongNumber.
wrongDifficulty
wrongGasLimit
wrongParentHash
log1_wrongBlockNumber

bcUncleTest.json
threeUncle

logging from these is very similar:

        "postState" : {
            "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
                "balance" : "5000000100",
                "code" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600052600060206000a1",
                "nonce" : "0",
                "storage" : {
                }
            },
            "8888f1f195afa192cfee860698584c030f4c9db1" : {
                "balance" : "1500000000000220270",
                "code" : "0x",
                "nonce" : "0",
                "storage" : {
                }
            },
            "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
                "balance" : "4999779730",
                "code" : "0x",
                "nonce" : "1",
                "storage" : {
                }
            }
        },

versus what we're seeing in Java and Cpp

   current: 2
05:40:54.128 [DEBUG] [TestEventLogger]     05:40:54.081 [TCK-Test]  Account: 095e7baea6a6c7c4c2dfeb977efac326af552d87: has unexpected balance, expected balance: 5000000100 found balance: 100
05:40:54.129 [DEBUG] [TestEventLogger]     05:40:54.081 [TCK-Test]  Account: a94f5374fce5edbc8e2a8697c15331677e6ebf0b: has unexpected balance, expected balance: 4999779730 found balance: 10000000000
05:40:54.129 [DEBUG] [TestEventLogger]     05:40:54.083 [TCK-Test]  Account: a94f5374fce5edbc8e2a8697c15331677e6ebf0b: has unexpected nonce, expected nonce: 1 found nonce: 0
05:40:54.130 [DEBUG] [TestEventLogger]     05:40:54.083 [TCK-Test]  Account: 8888f1f195afa192cfee860698584c030f4c9db1: expected but doesn't exist
05:40:54.131 [DEBUG] [TestEventLogger]     05:40:54.083 [TCK-Test]  Root hash don't much: expected: f93c8db1e931daa2e22e39b5d2da6fb4074e3d544094857608536155e3521bc1 current: 925002c3260b44e44c3edebad1cc442142b03020209df1ab8bb86752edbd2cd7

have problem to run VMTests suite in cli

./testeth --log_level=test_suite --run_test=VMTests/userDefinedFileState --statetest /home/tests/VMTests/vmSystemOperationsTest.json CallToNameRegistratorNotMuchMemory0

also tried

./testeth --log_level=test_suite --run_test=VMTests/userDefinedFileState --vmtest /home/tests/VMTests/vmSystemOperationsTest.json  ABAcallsSuicide0

is it a valid syntax ?

More intuitive interpretation of pre, exec and post requested

As I understood from @CJentzsch, the tests are created with the assumption that certain values used in the exec-part of the test, are assumed to be present, whereas it is more intuitive to define them in the pre-state of the test.

Example

balance0 in vmEnvironmentalInfoTest.json expects to have account 0xcd1722f3947def4cf144679da39c4c32bdc35681 in the post-state, but the pre-state doesn't define it.

Also, the balance of 0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6 is defined both in the pre-state and post-state as 1000000000000000000 while the exec-part transfers a value of 1000000000000000000 to that account.

Could the tests be adapted to the interpretation that any pre-defined account, actually gets defined in the pre-part of the test and not by interpreting the exec-state, unless that's part of the protocol?

So in this case it would mean that pre would become

        "pre" : {
            "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
                "balance" : "0",
                "code" : "0x73cd1722f3947def4cf144679da39c4c32bdc3568131600057",
                "nonce" : "0",
                "storage" : {
                }
            }
            "cd1722f3947def4cf144679da39c4c32bdc35681" : {
                "balance" : "1000000000000000000",
                "code" : "0x",
                "nonce" : "0",
                "storage" : {
                }
            }
        }

trietest.json: jeff test permutations?

It looks as though the tests in tests/TrieTests/trietest.json are intended to be permuted, with deletions tacked onto the end to ensure that all bindings both added and deleted end up deleted. (Or maybe I'm wrong? I'm trying to follow along from e.g. here.)

That works fine for most of the tests there, but not, i think for test jeff in the current version , which has two items with identical keys but distinct values, and whose key is not eventually deleted.

      ["0x000000000000000000000000697c7b8c961b56f675d570498424ac8de1a918f6", "0x1234567890"],
      ["0x000000000000000000000000697c7b8c961b56f675d570498424ac8de1a918f6", "0x6f6f6f6820736f2067726561742c207265616c6c6c793f000000000000000000"],

So the hash of the trie after permutations of operations are legitimately dependent upon which binding is updated last, I think.

I apologize if I am (not unusually) missing something obvious!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.