aboutsummaryrefslogtreecommitdiffstats
path: root/core/vm/jit_test.go
Commit message (Collapse)AuthorAgeFilesLines
* core/vm: improved EVM run loop & instruction calling (#3378)Jeffrey Wilcke2017-01-051-160/+0
| | | | | | | | | | | | | | | 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.
* core, core/vm: implemented a generic environment (#3348)Jeffrey Wilcke2016-12-061-60/+6
| | | | | | | | Environment is now a struct (not an interface). This reduces a lot of tech-debt throughout the codebase where a virtual machine environment had to be implemented in order to test or run it. The new environment is suitable to be used en the json tests, core consensus and light client.
* core/types, params: EIP#155Jeffrey Wilcke2016-11-131-1/+1
|
* core, core/state, trie: EIP158, reprice & skip empty account writeJeffrey Wilcke2016-11-131-1/+4
| | | | | | | | | | | | | | | 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>
* core/state: implement reverts by journaling all changesFelix Lange2016-10-061-2/+2
| | | | | | | | | | This commit replaces the deep-copy based state revert mechanism with a linear complexity journal. This commit also hides several internal StateDB methods to limit the number of ways in which calling code can use the journal incorrectly. As usual consultation and bug fixes to the initial implementation were provided by @karalabe, @obscuren and @Arachnid. Thank you!
* cmd, core, internal, light, tests: avoid hashing the code in the VMPéter Szilágyi2016-10-011-1/+1
|
* core/vm, eth: Add support for javascript trace functionsNick Johnson2016-08-231-7/+4
|
* core/vm: Refactor tracing to make Tracer the main interfaceNick Johnson2016-08-221-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | This CL makes several refactors: - Define a Tracer interface, implementing the `CaptureState` method - Add the VM environment as the first argument of `Tracer.CaptureState` - Rename existing functionality `StructLogger` an make it an implementation of `Tracer` - Delete `StructLogCollector` and make `StructLogger` collect the logs directly - Change all callers to use the new `StructLogger` where necessary and extract logs from that. - Deletes the apparently obsolete and likely nonfunctional 'TraceCall' from the eth API. Callers that only wish accumulated logs can use the `StructLogger` implementation straightforwardly. Callers that wish to efficiently capture VM traces and operate on them without excessive copying can now implement the `Tracer` interface to receive VM state at each step and do with it as they wish. This CL also removes the accumulation of logs from the vm.Environment; this was necessary as part of the refactor, but also simplifies it by removing a responsibility that doesn't directly belong to the Environment.
* Revert "test, cmd/evm, core, core/vm: illegal code hash implementation"Péter Szilágyi2016-06-291-5/+4
| | | | This reverts commit 7a5b571c671e70e0e4807cf971c15e2d1e09d33d.
* test, cmd/evm, core, core/vm: illegal code hash implementationJeffrey Wilcke2016-06-221-4/+5
| | | | | | | | This implements a generic approach to enabling soft forks by allowing anyone to put in hashes of contracts that should not be interacted from. This will help "The DAO" in their endevour to stop any whithdrawals from any DAO contract by convincing the mining community to accept their code hash.
* all: update license informationFelix Lange2016-04-151-1/+2
|
* core: added basic chain configurationJeffrey Wilcke2016-04-011-7/+8
| | | | | | | | | 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.
* core: Added EVM configuration optionsJeffrey Wilcke2016-03-241-14/+14
| | | | | The EVM is now initialised with an additional configured object that allows you to turn on debugging options.
* core, core/vm, tests: changed the initialisation behaviour of the EVMJeffrey Wilcke2016-03-231-2/+6
| | | | | | | The EVM was previously initialised and created for every CALL, CALLCODE, DELEGATECALL and CREATE. This PR changes this behaviour so that the same EVM can be used through the session and beyond as long as the Environment sticks around.
* core: various typosLeif Jurvetson2016-03-161-1/+1
|
* all: Rename crypto.Sha3{,Hash}() to crypto.Keccak256{,Hash}()Ricardo Catalinas Jiménez2016-02-221-1/+1
| | | | As we aren't really using the standarized SHA-3
* core, core/vm, crypto: fixes for homesteadJeffrey Wilcke2016-02-181-0/+5
| | | | | | * Removed some strange code that didn't apply state reverting properly * Refactored code setting from vm & state transition to the executioner * Updated tests
* core/vm: resolve circular dependency to debug vm storagePéter Szilágyi2016-01-121-8/+9
|
* core/vm: added JIT segmenting / optimisationsJeffrey Wilcke2015-10-171-0/+43
| | | | | * multi-push segments * static jumps segments
* core, core/vm, cmd/evm: remove redundant balance checkGustav Simonsson2015-10-061-3/+1
|
* cmd/evm, core/vm, test: refactored VM and coreJeffrey Wilcke2015-10-041-24/+68
| | | | | | | | | | | | | | | | | * Moved `vm.Transfer` to `core` package and changed execution to call `env.Transfer` instead of `core.Transfer` directly. * core/vm: byte code VM moved to jump table instead of switch * Moved `vm.Transfer` to `core` package and changed execution to call `env.Transfer` instead of `core.Transfer` directly. * Byte code VM now shares the same code as the JITVM * Renamed Context to Contract * Changed initialiser of state transition & unexported methods * Removed the Execution object and refactor `Call`, `CallCode` & `Create` in to their own functions instead of being methods. * Removed the hard dep on the state for the VM. The VM now depends on a Database interface returned by the environment. In the process the core now depends less on the statedb by usage of the env * Moved `Log` from package `core/state` to package `core/vm`.
* Add tests for uncle timestamps and refactor timestamp typeGustav Simonsson2015-08-251-1/+1
|
* cmd/evm, core/vm, tests: changed DisableVm to EnableVmJeffrey Wilcke2015-08-121-1/+1
|
* core, tests: reduced state copy by N callsJeffrey Wilcke2015-08-071-0/+3
| | | | | Reduced the amount of state copied that are required by N calls by doing a balance check prior to any state modifications.
* core/vm, tests: implemented semi-jit vmJeffrey Wilcke2015-08-071-0/+119
* changed stack and removed stack ptr. Let go decide on slice reuse.