aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYoichi Hirai <i@yoichihirai.com>2017-08-31 20:01:56 +0800
committerGitHub <noreply@github.com>2017-08-31 20:01:56 +0800
commitf93e53ddcf5220dceb9f22222e55b54ab90ddf8f (patch)
tree8b0b253d62286073b506c253a7007391fc0a87a8
parent2bf539099e93b87aa0149065f0bc0e60aa6811b9 (diff)
parent047ea6801d058a6bd58f0f7a3d4aaa6d659684a7 (diff)
downloaddexon-tests-f93e53ddcf5220dceb9f22222e55b54ab90ddf8f.tar.gz
dexon-tests-f93e53ddcf5220dceb9f22222e55b54ab90ddf8f.tar.zst
dexon-tests-f93e53ddcf5220dceb9f22222e55b54ab90ddf8f.zip
Merge pull request #292 from holgerd77/update-docs
Structural overhaul of the whole docs / Updated state test section / info box on test type status
-rw-r--r--docs/contribute.rst1
-rw-r--r--docs/index.rst19
-rw-r--r--docs/rlp_tests/index.rst50
-rw-r--r--docs/state_tests/index.rst132
-rw-r--r--docs/test_types/blockchain_tests.rst (renamed from docs/blockchain_tests/index.rst)66
-rw-r--r--docs/test_types/difficulty_tests.rst (renamed from docs/difficulty_tests/index.rst)20
-rw-r--r--docs/test_types/rlp_tests.rst64
-rw-r--r--docs/test_types/state_tests.rst159
-rw-r--r--docs/test_types/transaction_tests.rst (renamed from docs/transaction_tests/index.rst)19
-rw-r--r--docs/test_types/vm_tests.rst (renamed from docs/vm_tests/index.rst)74
-rw-r--r--docs/using-testeth.rst6
11 files changed, 365 insertions, 245 deletions
diff --git a/docs/contribute.rst b/docs/contribute.rst
index 02055b463..eab88d00f 100644
--- a/docs/contribute.rst
+++ b/docs/contribute.rst
@@ -1,6 +1,5 @@
.. _contribute:
-==================
Contribute to Docs
==================
diff --git a/docs/index.rst b/docs/index.rst
index cfd45916f..323902751 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -1,27 +1,26 @@
.. _ethereum_tests:
-################################################################################
+##############
Ethereum Tests
-################################################################################
+##############
| Common tests for all clients to test against. The `git repo <https://github.com/ethereum/tests>`_ updated regulary with new tests.
| This section describes basic test concepts and templates which are created by cpp-client.
|
.. note::
- Larger parts of the test docs are currently outdated (see :ref:`contribute` on how to
- help).
+ See :ref:`contribute` if you want to help improve this documentation.
.. toctree::
:maxdepth: 2
:caption: Contents:
using-testeth.rst
- blockchain_tests/index.rst
- state_tests/index.rst
- rlp_tests/index.rst
- difficulty_tests/index.rst
- transaction_tests/index.rst
- vm_tests/index.rst
+ test_types/blockchain_tests.rst
+ test_types/state_tests.rst
+ test_types/rlp_tests.rst
+ test_types/difficulty_tests.rst
+ test_types/transaction_tests.rst
+ test_types/vm_tests.rst
contribute.rst
diff --git a/docs/rlp_tests/index.rst b/docs/rlp_tests/index.rst
deleted file mode 100644
index 00ba3dc7b..000000000
--- a/docs/rlp_tests/index.rst
+++ /dev/null
@@ -1,50 +0,0 @@
-.. _rlp_tests:
-
-################################################################################
-RLP Tests
-################################################################################
-
-Describes an **RLP** (https://github.com/ethereum/wiki/wiki/RLP) encoding using the .json file.
-The client should read the rlp byte stream, **decode** and check whether the contents match its json representation. Then it should try do it reverse - **encode** json rlp representation into rlp byte stream and check whether it matches the given rlp byte stream.
-
-If it is an invalid RLP byte stream in the test, then 'in' field would contain string 'INVALID'
-
-Some RLP byte streams are expected to be generated by fuzz test suite. For those examples 'in' field would contain string 'VALID' as it means that rlp should be easily decoded.
-
-RLP tests are located in in ``/RLPTests``
-
-**Note** that RLP tests are testing a single RLP object encoding. Not a stream of RLP objects in one array.
-
-Basic structure
---------------------------------------------------------------------------------
-
-::
-
- {
- "rlpTest": {
- "in": "dog",
- "out": "83646f67"
- },
-
- "multilist": {
- "in": [ "zw", [ 4 ], 1 ],
- "out": "c6827a77c10401"
- },
-
- "validRLP": {
- "in": "VALID",
- "out": "c7c0c1c0c3c0c1c0"
- },
-
- "invalidRLP": {
- "in": "INVALID",
- "out": "bf0f000000000000021111"
- },
- ...
- }
-
-Sections
---------------------------------------------------------------------------------
-
-* ``in`` - json object (array, int, string) representation of the rlp byte stream (\*except values 'VALID' and 'INVALID')
-* ``out`` - string of rlp bytes stream
diff --git a/docs/state_tests/index.rst b/docs/state_tests/index.rst
deleted file mode 100644
index 978d2542a..000000000
--- a/docs/state_tests/index.rst
+++ /dev/null
@@ -1,132 +0,0 @@
-.. _state_tests:
-
-################################################################################
-General State Tests
-################################################################################
-
-Found in `/GeneralStateTests <https://github.com/ethereum/tests/tree/develop/GeneralStateTests>`_,
-the state tests aim is to test the basic workings of the state in isolation.
-
-A state test is based around the notion of executing a single transaction, described
-by the ``transaction`` portion of the test. The overarching environment
-in which it is executed is described by the ``env`` portion of the test and
-includes attributes of the current and previous blocks. A set of pre-existing accounts
-are detailed in the ``pre`` portion and form the world state prior to execution.
-Similarly, a set of accounts are detailed in the ``post`` portion to specify the
-end world state. Since the data of the blockchain is not given, the opcode ``BLOCKHASH``
-could not return the hashes of the corresponding blocks. Therefore we define the hash of
-block number ``n`` to be ``SHA256("n")``.
-
-The log entries (``logs``) as well as any output returned from the code (``output``) is also detailed.
-
-It is generally expected that the test implementer will read ``env``, ``transaction``
-and ``pre`` then check their results against ``logs``, ``out``, and ``post``.
-
-.. note::
- The structure description of state tests is outdated. A more up-to-date description
- can be found `here <https://github.com/ethereum/EIPs/issues/176>`_ and should be
- integrated in these docs in the future.
-
-Basic structure
---------------------------------------------------------------------------------
-
-::
-
- {
- "test name 1": {
- "env": { ... },
- "logs": { ... },
- "out": { ... },
- "post": { ... },
- "pre": { ... },
- "transaction": { ... },
- },
- "test name 2": {
- "env": { ... },
- "logs": { ... },
- "out": { ... },
- "post": { ... },
- "pre": { ... },
- "transaction": { ... },
- },
- ...
- }
-
-
-Sections
---------------------------------------------------------------------------------
-
-* **The** ``env`` **section:**
-
-| ``currentCoinbase``
-| The current block's coinbase address, to be returned by the `COINBASE` instruction.
-| ``currentDifficulty``
-| The current block's difficulty, to be returned by the `DIFFICULTY` instruction.
-| ``currentGasLimit``
-| The current block's gas limit.
-| ``currentNumber``
-| The current block's number. Also indicates network rules for the transaction. Since blocknumber = **1000000** Homestead rules are applied to transaction. (see https://github.com/ethereum/EIPs/blob/master/EIPS/eip-2.mediawiki)
-| ``currentTimestamp``
-| The current block's timestamp.
-| ``previousHash``
-| The previous block's hash.
-|
-
-* **The** ``transaction`` **section:**
-
-| ``data``
-| The input data passed to the execution, as used by the `CALLDATA`... instructions. Given as an array of byte values. See $DATA_ARRAY.
-| ``gasLimit``
-| The total amount of gas available for the execution, as would be returned by the `GAS` instruction were it be executed first.
-| ``gasPrice``
-| The price of gas for the transaction, as used by the `GASPRICE` instruction.
-| ``nonce``
-| Scalar value equal to the number of transactions sent by the sender.
-| ``address``
-| The address of the account under which the code is executing, to be returned by the `ADDRESS` instruction.
-| ``secretKey``
-| The secret key as can be derived by the v,r,s values if the transaction.
-| ``to``
-| The address of the transaction's recipient, to be returned by the `ORIGIN` instruction.
-| ``value``
-| The value of the transaction (or the endowment of the create), to be returned by the `CALLVALUE`` instruction (if executed first, before any `CALL`).
-|
-
-* **The** ``pre`` **and** ``post`` **sections each have the same format of a mapping between addresses and accounts. Each account has the format:**
-
-| ``balance``
-| The balance of the account.
-| ``nonce``
-| The nonce of the account.
-| ``code``
-| The body code of the account, given as an array of byte values. See $DATA_ARRAY.
-| ``storage``
-| The account's storage, given as a mapping of keys to values. For key used notion of string as digital or hex number e.g: ``"1200"`` or ``"0x04B0"`` For values used $DATA_ARRAY.
-|
-
-| The ``logs`` sections is a mapping between the blooms and their corresponding logentries.
-| Each logentry has the format:
-| ``address`` The address of the logentry.
-| ``data`` The data of the logentry.
-| ``topics`` The topics of the logentry, given as an array of values.
-|
-
-Finally, there is one simple key ``output``
-
-| ``output``
-| The data, given as an array of bytes, returned from the execution (using the ``RETURN`` instruction). See $DATA_ARRAY. In order to avoid big data files, there is one exception. If the output data is prefixed with ``#``, the following number represents the size of the output, and not the output directly.
-|
-
- **$DATA_ARRAY** - type that intended to contain raw byte data
- and for convenient of the users is populated with three
- types of numbers, all of them should be converted and
- concatenated to a byte array for VM execution.
-
- The types are:
-
- 1. number - (unsigned 64bit)
- 2. "longnumber" - (any long number)
- 3. "0xhex_num" - (hex format number)
-
-
- e.g: ``````[1, 2, 10000, "0xabc345dFF", "199999999999999999999999999999999999999"]`````` \ No newline at end of file
diff --git a/docs/blockchain_tests/index.rst b/docs/test_types/blockchain_tests.rst
index 27b8cd76d..c9b6dd359 100644
--- a/docs/blockchain_tests/index.rst
+++ b/docs/test_types/blockchain_tests.rst
@@ -1,17 +1,30 @@
.. _blockchain_tests:
-################################################################################
Blockchain Tests
-################################################################################
+================
-Found in `/BlockChainTests <https://github.com/ethereum/tests/tree/develop/BlockchainTests>`_,
-the blockchain tests aim is to test the basic verification of a blockchain.
+The blockchain tests aim is to test the basic verification of a blockchain.
+
+=================== ==============================================================
+Location `/BlockchainTests <https://github.com/ethereum/tests/tree/develop/BlockchainTests>`_
+Supported Hardforks ``Byzantium`` | ``Constantinople`` | ``EIP150`` | ``EIP158`` | ``Frontier`` | ``Homestead``
+Status Actively supported
+=================== ==============================================================
A blockchain test is based around the notion of executing a list of single blocks,
described by the ``blocks`` portion of the test. The first block is the modified
genesis block as described by the ``genesisBlockHeader`` portion of the test.
A set of pre-existing accounts are detailed in the ``pre`` portion and form the
-world state of the genesis block.
+world state of the genesis block.
+
+Of special notice is the
+`/BlockchainTests/GeneralStateTests <https://github.com/ethereum/tests/tree/develop/BlockchainTests/GeneralStateTests>`_
+folder within the blockchain tests folder structure, which contains a copy of the
+:ref:`state_tests` but executes them within the logic of the blockchain tests.
+
+
+Test Implementation
+-------------------
It is generally expected that the test implementer will read ``genesisBlockHeader``
and ``pre`` and build the corresponding blockchain in the client. Then the new blocks,
@@ -23,8 +36,8 @@ it should execute the block and verify the parameters given in ``blockHeader``
that no ``blockHeader``, ``transactions`` or ``uncleHeaders`` object is present in the test.
The client is expected to iterate through the list of blocks and ignore invalid blocks.
-Basic structure
---------------------------------------------------------------------------------
+Test Structure
+--------------
::
@@ -79,10 +92,26 @@ Basic structure
}
-Sections
---------------------------------------------------------------------------------
+The Blocks Section
+^^^^^^^^^^^^^^^^^^
+
+The ``blocks`` section is a list of block objects, which have the following format:
+
+* ``rlp`` section contains the complete rlp of the new block as described in the
+ yellow paper in section 4.3.3.
-* The ``genesisBlockHeader`` section
+* ``blockHeader`` section describes the block header of the new block in the same
+ format as described in `genesisBlockHeader`.
+
+* ``transactions`` section is a list of transactions which have the same format as
+ in :ref:`transaction_tests`.
+
+* ``uncleHeaders`` section is a list of block headers which have the same format as
+ descibed in `genesisBlockHeader`.
+
+
+The genesisBlockHeader Section
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
``coinbase``:
The 160-bit address to which all fees collected from the successful mining of this block be
@@ -123,22 +152,17 @@ Sections
``uncleHash``:
The Keccak 256-bit hash of the uncles list portion of this block
-* ``pre`` section: as described in State Tests.
-
-* ``postState`` section: as described in State Tests (section - post).
-
-* ``blocks`` section is a list of block objects, which have the following format:
-* ``rlp`` section contains the complete rlp of the new block as described in the yellow paper in section 4.3.3.
+Pre and postState Sections
+^^^^^^^^^^^^^^^^^^^^^^^^^^
-* ``blockHeader`` section describes the block header of the new block in the same format as described in `genesisBlockHeader`.
+* ``pre`` section: as described in :ref:`state_tests`.
-* ``transactions`` section is a list of transactions which have the same format as in Transaction Tests.
+* ``postState`` section: as described in :ref:`state_tests` (section - post).
-* ``uncleHeaders`` section is a list of block headers which have the same format as descibed in `genesisBlockHeader`.
-Optional BlockHeader Sections (Information fields)
---------------------------------------------------------------------------------
+Optional BlockHeader Information
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
``"blocknumber" = "int"`` is section which defines what is the order of this block.
It is used to define a situation when you have 3 blocks already imported but then it comes new version of the block 2 and 3 and thus you might have new best blockchain with blocks 1 2' 3' instead previous. If `blocknumber` is undefined then it is assumed that blocks are imported one by one. When running test, this field could be used for information purpose only.
diff --git a/docs/difficulty_tests/index.rst b/docs/test_types/difficulty_tests.rst
index 2125169f5..a72e5cb9a 100644
--- a/docs/difficulty_tests/index.rst
+++ b/docs/test_types/difficulty_tests.rst
@@ -1,14 +1,19 @@
.. _difficulty_tests:
-################################################################################
Difficulty Tests
-################################################################################
+================
-Found in ``\Basic Tests\difficulty*.json`` files. This tests are designed to just check the difficulty formula of a block.
+These tests are designed to just check the difficulty formula of a block.
+
+=================== ==============================================================
+Location `\BasicTests <https://github.com/ethereum/tests/tree/develop/BasicTests>`_ (difficulty*.json)
+Supported Hardforks ``Test Networks`` | ``Frontier`` | ``Homestead``
+Status Outdated
+=================== ==============================================================
difficulty = DIFFICULTY(currentBlockNumber, currentTimestamp, parentTimestamp, parentDifficulty)
-described at [EIP2](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-2.mediawiki) point 4 with homestead changes.
+described at `EIP2 <https://github.com/ethereum/EIPs/blob/master/EIPS/eip-2.mediawiki>`_ point 4 with homestead changes.
So basically this .json tests are just to check how this function is calculated on different function parameters (parentDifficulty, currentNumber) in its extremum points.
@@ -27,8 +32,8 @@ There are several test files:
``difficultyCustomHomestead.json``
Tests for homestead difficulty (regardless of the block number)
-Basic structure
---------------------------------------------------------------------------------
+Test Structure
+--------------
::
{
@@ -42,7 +47,8 @@ Basic structure
}
Sections
---------------------------------------------------------------------------------
+^^^^^^^^
+
* ``parentTimestamp`` - indicates the timestamp of a previous block
* ``parentDifficulty`` - indicates the difficulty of a previous block
* ``currentTimestamp`` - indicates the timestamp of a current block
diff --git a/docs/test_types/rlp_tests.rst b/docs/test_types/rlp_tests.rst
new file mode 100644
index 000000000..2d812aae6
--- /dev/null
+++ b/docs/test_types/rlp_tests.rst
@@ -0,0 +1,64 @@
+.. _rlp_tests:
+
+RLP Tests
+=========
+
+Describes an **RLP** (https://github.com/ethereum/wiki/wiki/RLP) encoding using
+the .json file.
+
+=================== ==============================================================
+Location `/RLPTests <https://github.com/ethereum/tests/tree/develop/RLPTests>`_
+Supported Hardforks Hardfork-independent
+Status Actively supported
+=================== ==============================================================
+
+
+Test Implementation
+-------------------
+
+The client should read the rlp byte stream, **decode** and check
+whether the contents match its json representation. Then it should try do it
+reverse - **encode** json rlp representation into rlp byte stream and check whether
+it matches the given rlp byte stream.
+
+If it is an invalid RLP byte stream in the test, then 'in' field would contain string ``INVALID``.
+
+Some RLP byte streams are expected to be generated by fuzz test suite. For those
+examples 'in' field would contain string ``VALID`` as it means that rlp should be easily decoded.
+
+**Note** that RLP tests are testing a single RLP object encoding and not a stream of
+RLP objects in one array.
+
+Test Structure
+--------------
+
+::
+
+ {
+ "rlpTest": {
+ "in": "dog",
+ "out": "83646f67"
+ },
+
+ "multilist": {
+ "in": [ "zw", [ 4 ], 1 ],
+ "out": "c6827a77c10401"
+ },
+
+ "validRLP": {
+ "in": "VALID",
+ "out": "c7c0c1c0c3c0c1c0"
+ },
+
+ "invalidRLP": {
+ "in": "INVALID",
+ "out": "bf0f000000000000021111"
+ },
+ ...
+ }
+
+Sections
+^^^^^^^^
+
+* ``in`` - json object (array, int, string) representation of the rlp byte stream (\*except values ``VALID`` and ``INVALID``)
+* ``out`` - string of rlp bytes stream
diff --git a/docs/test_types/state_tests.rst b/docs/test_types/state_tests.rst
new file mode 100644
index 000000000..facb66187
--- /dev/null
+++ b/docs/test_types/state_tests.rst
@@ -0,0 +1,159 @@
+.. _state_tests:
+
+General State Tests
+===================
+
+The state tests aim is to test the basic workings of the state in isolation.
+
+=================== ==============================================================
+Location `/GeneralStateTests <https://github.com/ethereum/tests/tree/develop/GeneralStateTests>`_
+Supported Hardforks ``Byzantium`` | ``Constantinople`` | ``EIP150`` | ``EIP158`` | ``Frontier`` | ``Homestead``
+Status Actively supported
+=================== ==============================================================
+
+A state test is based around the notion of executing a single transaction, described
+by the ``transaction`` portion of the test. The overarching environment
+in which it is executed is described by the ``env`` portion of the test and
+includes attributes of the current and previous blocks. A set of pre-existing accounts
+are detailed in the ``pre`` portion and form the world state prior to execution.
+Similarly, a set of accounts are detailed in the ``post`` portion to specify the
+end world state. Since the data of the blockchain is not given, the opcode ``BLOCKHASH``
+could not return the hashes of the corresponding blocks. Therefore we define the hash of
+block number ``n`` to be ``SHA256("n")``.
+
+The log entries (``logs``) as well as any output returned from the code (``output``) is also detailed.
+
+Test Implementation
+-------------------
+
+It is generally expected that the test implementer will read ``env``, ``transaction``
+and ``pre`` then check their results against ``logs``, ``out``, and ``post``.
+
+.. note::
+ The structure of state tests was reworked lately, see the associated discussion
+ `here <https://github.com/ethereum/EIPs/issues/176>`_.
+
+Test Structure
+--------------
+
+::
+
+ {
+ "testname" : {
+ "env" : {
+ "currentCoinbase" : "address",
+ "currentDifficulty" : "0x020000", //minimum difficulty for mining on blockchain
+ "currentGasLimit" : "u64", //not larger then maxGasLimit = 0x7fffffffffffffff
+ "currentNumber" : "0x01", //Irrelevant to hardfork parameters!
+ "currentTimestamp" : "1000", //for blockchain version
+ "previousHash" : "h256"
+ },
+ "post" : {
+ "EIP150" : [
+ {
+ "hash" : "3e6dacc1575c6a8c76422255eca03529bbf4c0dda75dfc110b22d6dc4152396f",
+ "indexes" : { "data" : 0, "gas" : 0, "value" : 0 }
+ },
+ {
+ "hash" : "99a450d8ce5b987a71346d8a0a1203711f770745c7ef326912e46761f14cd764",
+ "indexes" : { "data" : 0, "gas" : 0, "value" : 1 }
+ },
+ ...
+ ],
+ "EIP158" : [
+ {
+ "hash" : "3e6dacc1575c6a8c76422255eca03529bbf4c0dda75dfc110b22d6dc4152396f",
+ "indexes" : { "data" : 0, "gas" : 0, "value" : 0 }
+ },
+ {
+ "hash" : "99a450d8ce5b987a71346d8a0a1203711f770745c7ef326912e46761f14cd764",
+ "indexes" : { "data" : 0, "gas" : 0, "value" : 1 }
+ },
+ ...
+ ],
+ "Frontier" : [
+ ...
+ ],
+ "Homestead" : [
+ ...
+ ]
+ },
+ "pre" : {
+ //same as for StateTests
+ },
+ "transaction" : {
+ "data" : [ "" ],
+ "gasLimit" : [ "285000", "100000", "6000" ],
+ "gasPrice" : "0x01",
+ "nonce" : "0x00",
+ "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
+ "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87",
+ "value" : [ "10", "0" ]
+ }
+ }
+ }
+
+
+The env Section
+^^^^^^^^^^^^^^^
+
+| ``currentCoinbase``
+| The current block's coinbase address, to be returned by the `COINBASE` instruction.
+| ``currentDifficulty``
+| The current block's difficulty, to be returned by the `DIFFICULTY` instruction.
+| ``currentGasLimit``
+| The current block's gas limit.
+| ``currentNumber``
+| The current block's number. Also indicates network rules for the transaction. Since blocknumber = **1000000** Homestead rules are applied to transaction. (see https://github.com/ethereum/EIPs/blob/master/EIPS/eip-2.mediawiki)
+| ``currentTimestamp``
+| The current block's timestamp.
+| ``previousHash``
+| The previous block's hash.
+|
+
+The transaction Section
+^^^^^^^^^^^^^^^^^^^^^^^
+
+| ``data``
+| The input data passed to the execution, as used by the `CALLDATA`... instructions. Given as an array of byte values. See $DATA_ARRAY.
+| ``gasLimit``
+| The total amount of gas available for the execution, as would be returned by the `GAS` instruction were it be executed first.
+| ``gasPrice``
+| The price of gas for the transaction, as used by the `GASPRICE` instruction.
+| ``nonce``
+| Scalar value equal to the number of transactions sent by the sender.
+| ``address``
+| The address of the account under which the code is executing, to be returned by the `ADDRESS` instruction.
+| ``secretKey``
+| The secret key as can be derived by the v,r,s values if the transaction.
+| ``to``
+| The address of the transaction's recipient, to be returned by the `ORIGIN` instruction.
+| ``value``
+| The value of the transaction (or the endowment of the create), to be returned by the `CALLVALUE`` instruction (if executed first, before any `CALL`).
+|
+
+The post Section
+^^^^^^^^^^^^^^^^
+
+``Indexes`` section describes which values from given array to set for transaction
+before it's execution on a pre state. Transaction now has data, value, and gasLimit as arrays.
+post section now has array of implemented forks. For each fork it has another array
+of execution results on that fork rules with post state root hash and transaction parameters.
+
+The pre Section
+^^^^^^^^^^^^^^^
+
+The ``pre`` section have the format of a mapping between addresses and accounts.
+Each account has the format:
+
+| ``balance``
+| The balance of the account.
+| ``nonce``
+| The nonce of the account.
+| ``code``
+| The body code of the account, given as an array of byte values. See $DATA_ARRAY.
+| ``storage``
+| The account's storage, given as a mapping of keys to values. For key used notion of string as digital or hex number e.g: ``"1200"`` or ``"0x04B0"`` For values used $DATA_ARRAY.
+|
+
+
diff --git a/docs/transaction_tests/index.rst b/docs/test_types/transaction_tests.rst
index ffe65247d..f4bac251d 100644
--- a/docs/transaction_tests/index.rst
+++ b/docs/test_types/transaction_tests.rst
@@ -1,15 +1,24 @@
.. _transaction_tests:
-################################################################################
Transaction Tests
-################################################################################
+=================
Describes a complete transaction and its `RLP <https://github.com/ethereum/wiki/wiki/RLP>`_ representation using the .json file.
+
+=================== ==============================================================
+Location `/TransactionTests <https://github.com/ethereum/tests/tree/develop/TransactionTests>`_
+Supported Hardforks ``Constantinople`` | ``EIP158`` | ``Frontier`` | ``Homestead``
+Status Actively supported
+=================== ==============================================================
+
+Test Implementation
+-------------------
+
The client should read the rlp and check whether the transaction is valid, has the correct sender and corresponds to the transaction parameters.
If it is an invalid transaction, the transaction and the sender object will be missing.
-Basic structure
---------------------------------------------------------------------------------
+Test Structure
+--------------
::
{
@@ -37,7 +46,7 @@ Basic structure
}
Sections
---------------------------------------------------------------------------------
+^^^^^^^^
* ``rlp`` - RLP encoded data of this transaction
* ``transaction`` - transaction described by fields
diff --git a/docs/vm_tests/index.rst b/docs/test_types/vm_tests.rst
index 732c4d08b..4ab33c921 100644
--- a/docs/vm_tests/index.rst
+++ b/docs/test_types/vm_tests.rst
@@ -1,23 +1,53 @@
.. _vm_tests:
-################################################################################
VM Tests
-################################################################################
+========
-Found in ``/VMTest``, the VM tests aim is to test the basic workings of the VM in isolation. This is specifically not meant to cover transaction, creation or call processing, or management of the state trie. Indeed at least one implementation tests the VM without calling into any Trie code at all.
+The VM tests aim is to test the basic workings of the VM in
+isolation.
-It is based around the notion of executing a single piece of code as part of a transaction, described by the ``exec`` portion of the test. The overarching environment in which it is executed is described by the ``env`` portion of the test and includes attributes of the current and previous blocks. A set of pre-existing accounts are detailed in the ``pre`` portion and form the world state prior to execution. Similarly, a set of accounts are detailed in the ``post`` portion to specify the end world state.
+=================== ==============================================================
+Location `/VMTests <https://github.com/ethereum/tests/tree/develop/VMTests>`_
+Supported Hardforks Currently only one fork support depending on latest test fill
+Status Actively supported
+=================== ==============================================================
-The gas remaining (``gas``), the log entries (``logs``) as well as any output returned from the code (``output``) is also detailed.
+This is specifically not meant to cover transaction, creation or call
+processing, or management of the state trie. Indeed at least one implementation
+tests the VM without calling into any Trie code at all.
-Because the data of the blockchain is not given, the opcode BLOCKHASH could not return the hashes of the corresponding blocks. Therefore we define the hash of block number n to be SHA3-256("n").
+A VM test is based around the notion of executing a single piece of code as part of a transaction,
+described by the ``exec`` portion of the test. The overarching environment in which it is
+executed is described by the ``env`` portion of the test and includes attributes
+of the current and previous blocks. A set of pre-existing accounts are detailed
+in the ``pre`` portion and form the world state prior to execution. Similarly, a set
+of accounts are detailed in the ``post`` portion to specify the end world state.
-Since these tests are meant only as a basic test of VM operation, the ``CALL`` and ``CREATE`` instructions are not actually executed. To provide the possibility of testing to guarantee they were actually run at all, a separate portion ``callcreates`` details each ``CALL`` or ``CREATE`` operation in the order they would have been executed. Furthermore, gas required is simply that of the VM execution: the gas cost for transaction processing is excluded.
+The gas remaining (``gas``), the log entries (``logs``) as well as any output returned
+from the code (``output``) is also detailed.
-It is generally expected that the test implementer will read ``env``, ``exec`` and ``pre`` then check their results against ``gas``, ``logs``, ``out``, ``post`` and ``callcreates``. If an exception is expected, then latter sections are absent in the test. Since the reverting of the state is not part of the VM tests.
-Basic structure
---------------------------------------------------------------------------------
+Test Implementation
+-------------------
+
+It is generally expected that the test implementer will read ``env``, ``exec`` and ``pre``
+then check their results against ``gas``, ``logs``, ``out``, ``post`` and ``callcreates``.
+If an exception is expected, then latter sections are absent in the test. Since the
+reverting of the state is not part of the VM tests.
+
+Because the data of the blockchain is not given, the opcode BLOCKHASH could not
+return the hashes of the corresponding blocks. Therefore we define the hash of
+block number n to be SHA3-256("n").
+
+Since these tests are meant only as a basic test of VM operation, the ``CALL`` and
+``CREATE`` instructions are not actually executed. To provide the possibility of
+testing to guarantee they were actually run at all, a separate portion ``callcreates``
+details each ``CALL`` or ``CREATE`` operation in the order they would have been executed.
+Furthermore, gas required is simply that of the VM execution: the gas cost for
+transaction processing is excluded.
+
+Test Structure
+--------------
::
@@ -45,10 +75,8 @@ Basic structure
...
}
-Sections
---------------------------------------------------------------------------------
-
-The ``env`` section:
+The env Section
+^^^^^^^^^^^^^^^
* ``currentCoinbase``: The current block's coinbase address, to be returned by the ``COINBASE`` instruction.
* ``currentDifficulty``: The current block's difficulty, to be returned by the ``DIFFICULTY`` instruction.
@@ -57,7 +85,8 @@ The ``env`` section:
* ``currentTimestamp``: The current block's timestamp.
* ``previousHash``: The previous block's hash.
-The ``exec`` section:
+The exec Section
+^^^^^^^^^^^^^^^^
* ``address``: The address of the account under which the code is executing, to be returned by the ``ADDRESS`` instruction.
* ``origin``: The address of the execution's origin, to be returned by the ``ORIGIN`` instruction.
@@ -68,6 +97,9 @@ The ``exec`` section:
* ``gasPrice``: The price of gas for the transaction, as used by the ``GASPRICE`` instruction.
* ``gas``: The total amount of gas available for the execution, as would be returned by the ``GAS`` instruction were it be executed first.
+The pre and post Section
+^^^^^^^^^^^^^^^^^^^^^^^^
+
The ``pre`` and ``post`` sections each have the same format of a mapping between addresses and accounts. Each account has the format:
* ``balance``: The balance of the account.
@@ -75,6 +107,9 @@ The ``pre`` and ``post`` sections each have the same format of a mapping between
* ``code``: The body code of the account, given as an array of byte values. See $DATA_ARRAY.
* ``storage``: The account's storage, given as a mapping of keys to values. For key used notion of string as digital or hex number e.g: ``"1200"`` or ``"0x04B0"`` For values used $DATA_ARRAY.
+The callcreates Section
+^^^^^^^^^^^^^^^^^^^^^^^
+
The ``callcreates`` section details each ``CALL`` or ``CREATE`` instruction that has been executed. It is an array of maps with keys:
* ``data``: An array of bytes specifying the data with which the ``CALL`` or ``CREATE`` operation was made. In the case of ``CREATE``, this would be the (initialisation) code. See $DATA_ARRAY.
@@ -82,12 +117,19 @@ The ``callcreates`` section details each ``CALL`` or ``CREATE`` instruction that
* ``gasLimit``: The amount of gas with which the operation was made.
* ``value``: The value or endowment with which the operation was made.
-The ``logs`` sections is a mapping between the blooms and their corresponding logentries. Each logentry has the format:
+The logs Section
+^^^^^^^^^^^^^^^^
+
+The ``logs`` sections is a mapping between the blooms and their corresponding logentries.
+Each logentry has the format:
* ``address``: The address of the logentry.
* ``data``: The data of the logentry.
* ``topics``: The topics of the logentry, given as an array of values.
+The gas and output Keys
+^^^^^^^^^^^^^^^^^^^^^^^
+
Finally, there are two simple keys, ``gas`` and ``output``:
* ``gas``: The amount of gas remaining after execution.
diff --git a/docs/using-testeth.rst b/docs/using-testeth.rst
index 49ef3945a..390225d7f 100644
--- a/docs/using-testeth.rst
+++ b/docs/using-testeth.rst
@@ -1,7 +1,7 @@
-*****************************************************
Using Testeth
-*****************************************************
+=============
+
Ethereum cpp-client testeth tool for creation and execution of ethereum tests.
To run tests you should open folder (see also `Installing and building <http://www.ethdocs.org/en/latest/ethereum-clients/cpp-ethereum/index.html#installing-and-building>`_
@@ -51,7 +51,7 @@ That's it for test execution. To read more about command line options you may ru
Now let's see what test cases are available.
Test Cases
---------------------------------------------------------------------------------
+----------
Almost each test case has its filler file available at ``/webthree-umbrella/libethereum/test``