Commit Graph

32 Commits

Author SHA1 Message Date
Martin Holst Swende
8cab3ab435 cmd/evm: adds ability to run individual state test file (#14998)
* cmd/evm: adds ability to run individual state test file

* cmd/evm: Fix statetest runner to be more json friendly

* cmd/evm, tests: minor polishes, dump state on fail
2017-09-05 12:24:26 +03:00
Martin Holst Swende
e7408b5552 core/vm: Make MaxCodesize non-retroactive (#15072)
* core/vm: Make max_codesize only applicable post Spurious Dragon/158/155/161/170

* tests: Remove expected failure
2017-09-04 12:53:25 +03:00
Péter Szilágyi
08f27428b4
core, tests: implement Metropolis EIP 684 2017-08-25 13:00:27 +03:00
Péter Szilágyi
3cc476c8ab
tests: enable Byzantium state tests for CI 2017-08-22 14:04:44 +03:00
Péter Szilágyi
1bbd400899
tests: skip the bad tests from colliding account touches 2017-08-17 16:50:36 +03:00
Felix Lange
6a56b15019 tests: update tests, use blockchain test "network" field
Blockchain tests now include the "network" which determines the chain
config to use. Remove config matching based on test name and share the
name-to-config index with state tests.

Byzantium/Constantinople tests are still skipped because most of them
fail anyway.
2017-08-11 12:34:03 +02:00
Felix Lange
225de7ca0a tests: update tests and implement general state tests (#14734)
Tests are now included as a submodule. This should make updating easier
and removes ~60MB of JSON data from the working copy.

State tests are replaced by General State Tests, which run the same test
with multiple fork configurations.

With the new test runner, consensus tests are run as subtests by walking
json files. Many hex issues have been fixed upstream since the last
update and most custom parsing code is replaced by existing JSON hex
types. Tests can now be marked as 'expected failures', ensuring that
fixes for those tests will trigger an update to test configuration. The
new test runner also supports parallel execution and the -short flag.
2017-07-11 13:49:14 +02:00
Péter Szilágyi
8f12d76a47
params: remove redundant consts, disable metro on AllProtocolChanges 2017-07-04 12:28:58 +03:00
Jeffrey Wilcke
57f4e90257 Revert "params: core, core/vm, miner: 64bit gas instructions (#3514)"
This reverts commit 8b57c49490.
2017-02-13 15:15:12 +01:00
Jeffrey Wilcke
bbc4ea4ae8 core/vm: improved EVM run loop & instruction calling (#3378)
The run loop, which previously contained custom opcode executes have been
removed and has been simplified to a few checks.

Each operation consists of 4 elements: execution function, gas cost function,
stack validation function and memory size function. The execution function
implements the operation's runtime behaviour, the gas cost function implements
the operation gas costs function and greatly depends on the memory and stack,
the stack validation function validates the stack and makes sure that enough
items can be popped off and pushed on and the memory size function calculates
the memory required for the operation and returns it.

This commit also allows the EVM to go unmetered. This is helpful for offline
operations such as contract calls.
2017-01-05 11:52:10 +01:00
Jeffrey Wilcke
12d654a6fc core, core/state: fixed consensus issue added touch revert
Implemented proper touch revert journal entries and copied a Parity
consensus bug in order to remain in sync with the current longest chain.
2016-11-24 22:12:54 +01:00
Jeffrey Wilcke
a91908e567 tests: updated 2016-11-13 23:26:07 +01:00
Jeffrey Wilcke
5cd86443ee tests: added new EIP158 tests 2016-11-13 10:44:06 +01:00
Jeffrey Wilcke
445feaeef5 core, core/state, trie: EIP158, reprice & skip empty account write
This commit implements EIP158 part 1, 2, 3 & 4

1. If an account is empty it's no longer written to the trie. An empty
  account is defined as (balance=0, nonce=0, storage=0, code=0).
2. Delete an empty account if it's touched
3. An empty account is redefined as either non-existent or empty.
4. Zero value calls and zero value suicides no longer consume the 25k
  reation costs.

params: moved core/config to params

Signed-off-by: Jeffrey Wilcke <jeffrey@ethereum.org>
2016-11-13 10:44:04 +01:00
Jeffrey Wilcke
64af2aafda core, core/vm: added gas price variance table
This implements 1b & 1c of EIP150 by adding a new GasTable which must be
returned from the RuleSet config method. This table is used to determine
the gas prices for the current epoch.

Please note that when the CreateBySuicide gas price is set it is assumed
that we're in the new epoch phase.

In addition this PR will serve as temporary basis while refactorisation
in being done in the EVM64 PR, which will substentially overhaul the gas
price code.
2016-10-14 18:09:17 +02:00
Felix Lange
1b7b2ba216 tests: update test files from github.com/ethereum/tests @ 45bc1d21d3c1
Two new tests are skipped because they're buggy. Making some newer
random state tests work required implementing the 'compressed return
value encoding'.
2016-10-06 15:36:21 +02:00
Jeffrey Wilcke
f0cbebb19f core: added basic chain configuration
Added chain configuration options and write out during genesis database
insertion. If no "config" was found, nothing is written to the database.

Configurations are written on a per genesis base. This means
that any chain (which is identified by it's genesis hash) can have their
own chain settings.
2016-04-01 01:01:10 +02:00
Jeffrey Wilcke
b6d88a0e9f core, core/vm, crypto: fixes for homestead
* Removed some strange code that didn't apply state reverting properly
* Refactored code setting from vm & state transition to the executioner
* Updated tests
2016-02-18 10:11:48 +01:00
Jeffrey Wilcke
4f4d2b6474 tests: updated homestead tests 2016-02-18 10:08:18 +01:00
Gustav Simonsson
371871d685 parmas, crypto, core, core/vm: homestead consensus protocol changes
* change gas cost for contract creating txs
* invalidate signature with s value greater than secp256k1 N / 2
* OOG contract creation if not enough gas to store code
* new difficulty adjustment algorithm
* new DELEGATECALL op code
2016-02-18 10:08:11 +01:00
Gustav Simonsson
5621308949 tests: add test for StateTests/stCallCodes.json 2015-09-21 11:34:02 +02:00
Jeffrey Wilcke
9cacec70f9 cmd/evm, core/vm, tests: changed DisableVm to EnableVm 2015-08-11 18:43:22 +02:00
Jeffrey Wilcke
846f34f78b core/vm, tests: implemented semi-jit vm
* changed stack and removed stack ptr. Let go decide on slice reuse.
2015-08-07 12:52:17 +02:00
Felix Lange
bfbcfbe4a9 all: fix license headers one more time
I forgot to update one instance of "go-ethereum" in commit 3f047be5a.
2015-07-23 18:35:11 +02:00
Felix Lange
3f047be5aa all: update license headers to distiguish GPL/LGPL
All code outside of cmd/ is licensed as LGPL. The headers
now reflect this by calling the whole work "the go-ethereum library".
2015-07-22 18:51:45 +02:00
Felix Lange
ea54283b30 all: update license information 2015-07-07 14:12:44 +02:00
Taylor Gerring
0743243dce Add --skip option to CLI
Disassociates hardcoded tests to skip when running via CLI. Tests still
skipped when running `go test`
2015-06-19 11:38:23 +02:00
Taylor Gerring
b6d40a9312 Cleanup/reorg 2015-06-18 22:20:44 +02:00
Taylor Gerring
c5d6fcbaba Return error up stack instead of passing testing var down 2015-06-18 22:20:44 +02:00
Taylor Gerring
7c6ef0ddac Separate and identify tests runners 2015-06-18 22:15:07 +02:00
Taylor Gerring
e82100367f Fix paths 2015-06-18 22:13:42 +02:00
Taylor Gerring
a67a15528a Split tests from helper code 2015-06-18 22:13:42 +02:00