aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/evm
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #3728 from obscuren/format-tracePéter Szilágyi2017-03-022-43/+44
|\ | | | | core/evm, core/vm: improved evm trace output
| * cmd/evm: removed -sysstat and moved content to -debug flagJeffrey Wilcke2017-03-012-17/+21
| | | | | | | | | | | | Added the ability to directly compile and run ethereum assembly using the evm utility: `evm run <file>`. This is equivalant to `evm compile <file> | evm run`.
| * core/evm, core/vm: improved evm trace outputJeffrey Wilcke2017-03-011-27/+24
| | | | | | | | | | | | | | | | * Improved the standard evm tracer output and renamed it to WriteTrace which now takes an io.Writer to write the logs to. * Added WriteLogs which writes logs to the given writer in a readable format. * evm utility now also prints logs generated during the execution.
* | cmd/disasm, cmd/evm: integrate disasm tool into evm tool. (#3729)Valentin Wüstholz2017-03-012-0/+54
|/
* cmd/evm, core/asm: add EVM assembler (#3686)Jeffrey Wilcke2017-03-014-115/+242
| | | | | The evm compile command implements a simple assembly language that compiles to EVM bytecode.
* all: disable log message colors outside of gethFelix Lange2017-02-271-1/+1
| | | | Also tweak behaviour so colors are only enabled when stderr is a terminal.
* common: move big integer math to common/math (#3699)Felix Lange2017-02-271-12/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * common: remove CurrencyToString Move denomination values to params instead. * common: delete dead code * common: move big integer operations to common/math This commit consolidates all big integer operations into common/math and adds tests and documentation. There should be no change in semantics for BigPow, BigMin, BigMax, S256, U256, Exp and their behaviour is now locked in by tests. The BigD, BytesToBig and Bytes2Big functions don't provide additional value, all uses are replaced by new(big.Int).SetBytes(). BigToBytes is now called PaddedBigBytes, its minimum output size parameter is now specified as the number of bytes instead of bits. The single use of this function is in the EVM's MSTORE instruction. Big and String2Big are replaced by ParseBig, which is slightly stricter. It previously accepted leading zeros for hexadecimal inputs but treated decimal inputs as octal if a leading zero digit was present. ParseUint64 is used in places where String2Big was used to decode a uint64. The new functions MustParseBig and MustParseUint64 are now used in many places where parsing errors were previously ignored. * common: delete unused big integer variables * accounts/abi: replace uses of BytesToBig with use of encoding/binary * common: remove BytesToBig * common: remove Bytes2Big * common: remove BigTrue * cmd/utils: add BigFlag and use it for error-checked integer flags While here, remove environment variable processing for DirectoryFlag because we don't use it. * core: add missing error checks in genesis block parser * common: remove String2Big * cmd/evm: use utils.BigFlag * common/math: check for 256 bit overflow in ParseBig This is supposed to prevent silent overflow/truncation of values in the genesis block JSON. Without this check, a genesis block that set a balance larger than 256 bits would lead to weird behaviour in the VM. * cmd/utils: fixup import
* all: blidly swap out glog to our log15, logs need reworkPéter Szilágyi2017-02-231-3/+4
|
* core, core/state, core/vm: remove exported account getters (#3618)Jeffrey Wilcke2017-02-231-7/+11
| | | | Removed exported statedb object accessors, reducing the chance for nasty bugs to creep in. It's also ugly and unnecessary to have these methods.
* params: core, core/vm, miner: 64bit gas instructionsJeffrey Wilcke2017-02-141-2/+2
| | | | | | | | | | | | | | | | | Reworked the EVM gas instructions to use 64bit integers rather than arbitrary size big ints. All gas operations, be it additions, multiplications or divisions, are checked and guarded against 64 bit integer overflows. In additon, most of the protocol paramaters in the params package have been converted to uint64 and are now constants rather than variables. * common/math: added overflow check ops * core: vmenv, env renamed to evm * eth, internal/ethapi, les: unmetered eth_call and cancel methods * core/vm: implemented big.Int pool for evm instructions * core/vm: unexported intPool methods & verification methods * core/vm: added memoryGasCost overflow check and test
* Revert "params: core, core/vm, miner: 64bit gas instructions (#3514)"Jeffrey Wilcke2017-02-131-2/+2
| | | | This reverts commit 8b57c494908637a5c0e74f8f7a13b3218e026757.
* params: core, core/vm, miner: 64bit gas instructions (#3514)Jeffrey Wilcke2017-02-021-2/+2
| | | | | | | | | | | | | | | | Reworked the EVM gas instructions to use 64bit integers rather than arbitrary size big ints. All gas operations, be it additions, multiplications or divisions, are checked and guarded against 64 bit integer overflows. In additon, most of the protocol paramaters in the params package have been converted to uint64 and are now constants rather than variables. * common/math: added overflow check ops * core: vmenv, env renamed to evm * eth, internal/ethapi, les: unmetered eth_call and cancel methods * core/vm: implemented big.Int pool for evm instructions * core/vm: unexported intPool methods & verification methods * core/vm: added memoryGasCost overflow check and test
* cmd/evm: added debug flag (back) (#3554)Martin Holst Swende2017-01-231-0/+2
| | | | | | * evm: added debug flag (back) * cmd/evm: gofmt
* core/vm: improved EVM run loop & instruction calling (#3378)Jeffrey Wilcke2017-01-051-12/+9
| | | | | | | | | | | | | | | 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-114/+25
| | | | | | | | 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, core/state, trie: EIP158, reprice & skip empty account writeJeffrey Wilcke2016-11-131-18/+18
| | | | | | | | | | | | | | | 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>
* all: remove weird filesFelix Lange2016-10-302-2/+0
|
* cmd/evm: Allow stdin and files as sources of bytecode (#3172)Nick Johnson2016-10-291-4/+32
| | | | | | | | * cmd/evm: Allow stdin and files as sources of bytecode * cmd/evm: Print and exit instead of panicing * cmd/evm: fix compile and vet errors
* core, core/vm: added gas price variance tableJeffrey Wilcke2016-10-151-0/+4
| | | | | | | | | | | | | 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.
* core/state: implement reverts by journaling all changesFelix Lange2016-10-061-16/+16
| | | | | | | | | | 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/+4
|
* cmd/evm, cmd/geth, cmd/utils: move version handling to cmd/utilsFelix Lange2016-09-051-2/+4
|
* core/vm: Refactor tracing to make Tracer the main interfaceNick Johnson2016-08-221-8/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | 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-1/+0
| | | | This reverts commit 7a5b571c671e70e0e4807cf971c15e2d1e09d33d.
* test, cmd/evm, core, core/vm: illegal code hash implementationJeffrey Wilcke2016-06-221-0/+1
| | | | | | | | 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.
* cmd/evm: added --create flag indicating the exec code is to be createdJeffrey Wilcke2016-06-141-11/+34
| | | | | | | | | | This fixes an issue if you wanted to test out code deployment rather than running a piece of code with an argument. This solves it by adding a --create flag that indicates the Create function should be used rather than the Call function. This also adds a statedb.commit call so that the proper state can be dumped when requested using the --dump flag.
* cmd: fix CLI package deprecation warningsPéter Szilágyi2016-06-101-1/+2
|
* cmd/geth: codegansta/cli package renamed to urfave/cliBas van Kervel2016-06-091-1/+1
|
* core: added basic chain configurationJeffrey Wilcke2016-04-011-8/+11
| | | | | | | | | 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-6/+9
| | | | | 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-1/+8
| | | | | | | 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.
* parmas, crypto, core, core/vm: homestead consensus protocol changesGustav Simonsson2016-02-181-0/+5
| | | | | | | | * 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
* core/state, core, miner: handle missing root error from state.NewGustav Simonsson2015-10-161-1/+1
|
* core, core/vm, cmd/evm: remove redundant balance checkGustav Simonsson2015-10-061-2/+2
|
* cmd/evm, core/vm, test: refactored VM and coreJeffrey Wilcke2015-10-041-33/+31
| | | | | | | | | | | | | | | | | * 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-3/+3
|
* 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-6/+20
| | | | * changed stack and removed stack ptr. Let go decide on slice reuse.
* cmd/core,xeth: removed unneeded states & added batch writesJeffrey Wilcke2015-07-231-31/+81
|
* all: update license headers to distiguish GPL/LGPLFelix Lange2015-07-231-2/+2
| | | | | All code outside of cmd/ is licensed as LGPL. The headers now reflect this by calling the whole work "the go-ethereum library".
* all: add some godoc synopsis commentsFelix Lange2015-07-071-0/+1
|
* all: remove @author commentsFelix Lange2015-07-071-5/+0
|
* all: update license informationFelix Lange2015-07-071-16/+16
|
* Use uint64 for block header timestampGustav Simonsson2015-06-301-3/+3
|
* cmd/evm: print trace when running programsobscuren2015-06-111-0/+3
|
* cmd/evm: implements vm.Environmentobscuren2015-06-101-0/+7
|
* Fixed tests to reflect log changesobscuren2015-04-091-1/+1
|
* fixed testsobscuren2015-04-011-2/+2
|
* fixed testsobscuren2015-03-241-4/+4
|
* moved state and vm to coreobscuren2015-03-231-2/+2
|
* converted to proper typesobscuren2015-03-221-29/+29
|
* Moved ethutil => commonobscuren2015-03-161-6/+6
|
* cmd/evm, core, ethdb, state, tests/helper: remove ReadConfig callsFelix Lange2015-03-101-2/+0
|
* Secure trieobscuren2015-03-011-1/+0
|
* fixed testobscuren2015-02-051-0/+1
|
* Refactored ethutil.Config.Db outobscuren2015-01-071-2/+1
|
* cmd/evm: add dummy implementation for GetHashFelix Lange2015-01-061-0/+6
| | | | | Fixes the build. AFAIK evm does not bother keeping a chain and cannot provide a real implementation.
* Added license headersobscuren2015-01-061-2/+0
|
* Closure => Contextobscuren2015-01-021-3/+3
|
* fixed trieobscuren2014-12-301-2/+2
|
* Fixed EVM environment. Closes #215obscuren2014-12-211-3/+1
|
* Fixed testsobscuren2014-12-101-1/+1
|
* Log is now interfaceobscuren2014-12-041-1/+1
|
* sort tests for evmobscuren2014-12-043-6/+9
|
* Updated testing toolsobscuren2014-12-041-22/+68
|
* Removed all implicit logging. Fixed gas issues and jump errorsobscuren2014-11-121-2/+3
|
* Moved messages eventing to chain managerobscuren2014-11-101-1/+1
|
* Added dumpsobscuren2014-11-101-2/+9
|
* Added VM testing toolobscuren2014-11-101-0/+109