aboutsummaryrefslogtreecommitdiffstats
path: root/core/vm
Commit message (Collapse)AuthorAgeFilesLines
* core/vm, params: EIP160: EXP repriceJeffrey Wilcke2016-11-131-1/+2
|
* core, core/state, trie: EIP158, reprice & skip empty account writeJeffrey Wilcke2016-11-139-49/+72
| | | | | | | | | | | | | | | 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>
* common/math, core/vm: implement fast EXP (#3214)Jeffrey Wilcke2016-11-021-2/+3
| | | | | | | * common/math, core/vm: implement fast EXP. Courtesy @chfast & @karalabe * common/math: fix go vet issues on exp calculation
* Merge pull request #3064 from pirapira/limit_struct_logsJeffrey Wilcke2016-10-313-3/+14
|\ | | | | core/vm: add limit option to LogConfig
| * vm, ethapi: add `limit` option to traceTransactionYoichi Hirai2016-09-303-3/+14
| | | | | | | | | | | | | | | | | | | | | | | | that specifies the maximum number of elements in the `structLogs` output. This option is useful for debugging a transaction that involves a large number of repetition. For example, ``` debug.traceTransaction(tx, {disableStorage: true, limit: 2}) ``` shows at most the first two steps in the `structLogs`.
* | core/vm: Ignore EnableJit ChainConfig setting (#3166)Hao Bryan Cheng2016-10-211-1/+3
| |
* | core/vm: fix GASPRICE string (resolves #2553)Benjamin Brent2016-10-191-1/+1
| |
* | core, core/vm: added gas price variance tableJeffrey Wilcke2016-10-156-20/+115
| | | | | | | | | | | | | | | | | | | | | | | | | | 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: rename Delete/IsDeleted to Suicide/HasSuicidedFelix Lange2016-10-064-5/+8
| | | | | | | | The delete/remove naming has caused endless confusion in the past.
* | core/state: implement reverts by journaling all changesFelix Lange2016-10-063-8/+8
| | | | | | | | | | | | | | | | | | | | 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-016-12/+17
|/
* core/state: track all accounts in canon stateFelix Lange2016-09-262-1/+2
| | | | | This change introduces a global, per-state cache that keeps account data in the canon state. Thanks to @karalabe for lots of fixes.
* core/types, core/vm: improve docs, add JSON marshaling methodsFelix Lange2016-08-042-21/+127
| | | | | | | | In this commit, core/types's types learn how to encode and decode themselves as JSON. The encoding is very similar to what the RPC API uses. The RPC API is missing some output fields (e.g. transaction signature values) which will be added to the API in a later commit. Some fields that the API generates are ignored by the decoder methods here.
* core/vm, eth: Add support for javascript trace functionsNick Johnson2016-08-232-9/+6
|
* core/vm: Refactor tracing to make Tracer the main interfaceNick Johnson2016-08-2211-162/+136
| | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* core/vm: hide ecrecover error messageFelix Lange2016-08-061-2/+2
| | | | Fixes #2825
* Merge pull request #2724 from pirapira/fix_reset_feesPéter Szilágyi2016-07-152-2/+2
|\ | | | | vm: Replace some SstoreClearGas with SstoreResetGas
| * vm: Replace some SstoreClearGas with SstoreResetGasYoichi Hirai2016-06-222-2/+2
| |
* | eth: separate common and full node-specific API and backend servicezsfelfoldi2016-06-161-0/+2
|/
* all: fix go vet warningsFelix Lange2016-04-152-3/+1
|
* all: update license informationFelix Lange2016-04-1514-9/+90
|
* core: added basic chain configurationJeffrey Wilcke2016-04-0113-56/+72
| | | | | | | | | 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-2412-145/+336
| | | | | 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-239-39/+27
| | | | | | | 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-169-18/+18
|
* all: Rename crypto.Sha3{,Hash}() to crypto.Keccak256{,Hash}()Ricardo Catalinas Jiménez2016-02-227-8/+8
| | | | As we aren't really using the standarized SHA-3
* core, core/vm, crypto: fixes for homesteadJeffrey Wilcke2016-02-189-74/+123
| | | | | | * Removed some strange code that didn't apply state reverting properly * Refactored code setting from vm & state transition to the executioner * Updated tests
* parmas, crypto, core, core/vm: homestead consensus protocol changesGustav Simonsson2016-02-1810-37/+94
| | | | | | | | * 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/vm/runtime: simplified runtime calling mechanismJeffrey Wilcke2016-02-112-6/+93
| | | | | | Implemented `runtime.Call` which uses - unlike Execute - the given state for the execution and the address of the contract you wish to execute. Unlike `Execute`, `Call` requires a config.
* core/vm, rpc/api: renamed to debug.replayTransaction, migrated to new RPC, ↵Peter Pratscher2016-02-022-1/+3
| | | | | | | | integrated feedback Integrated code review suggestions Integrated last review comments
* core/vm: resolve circular dependency to debug vm storagePéter Szilágyi2016-01-124-14/+20
|
* rpc: new RPC implementation with pub/sub supportBas van Kervel2015-12-141-0/+16
|
* core/vm/runtime: added simple execution runtimeJeffrey Wilcke2015-11-185-0/+399
| | | | | | The runtime environment can be used for simple basic execution of contract code without the requirement of setting up a full stack and operates fully in memory.
* Merge pull request #1883 from obscuren/jit-vm-optimisationsJeffrey Wilcke2015-10-2210-83/+469
|\ | | | | core/vm: JIT segmentation
| * core/vm: added parsing utilitiesJeffrey Wilcke2015-10-174-3/+180
| |
| * core/vm: added JIT segmenting / optimisationsJeffrey Wilcke2015-10-178-5/+202
| | | | | | | | | | * multi-push segments * static jumps segments
| * core/vm: abstracted instruction execution away from JITJeffrey Wilcke2015-10-172-76/+88
| | | | | | | | | | | | Moved the execution of instructions to the instruction it self. This will allow for specialised instructions (e.g. segments) to be execution in the same manner as regular instructions.
* | Merge pull request #1889 from karalabe/fast-sync-rebaseJeffrey Wilcke2015-10-221-23/+28
|\ \ | | | | | | eth/63 fast synchronization algorithm
| * | core, eth, trie: fix data races and merge/review issuesPéter Szilágyi2015-10-211-1/+1
| | |
| * | core, eth: receipt chain reconstructionPéter Szilágyi2015-10-191-6/+8
| | |
| * | core: differentiate receipt concensus and storage decodingPéter Szilágyi2015-10-191-17/+20
| |/
* / core, tests: get_hash fixJeffrey Wilcke2015-10-211-1/+1
|/ | | | | Make sure that we're fetching the hash from the current chain and not the canonical chain.
* core/vm: copy stack element to prevent overwritesPéter Szilágyi2015-10-121-3/+4
|
* core, core/vm, cmd/evm: remove redundant balance checkGustav Simonsson2015-10-062-4/+2
|
* cmd/geth, cmd/utils, core, rpc: renamed to blockchainJeffrey Wilcke2015-10-045-11/+11
| | | | | | * Renamed ChainManager to BlockChain * Checkpointing is no longer required and never really properly worked when the state was corrupted.
* cmd/evm, core/vm, test: refactored VM and coreJeffrey Wilcke2015-10-0418-829/+764
| | | | | | | | | | | | | | | | | * 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`.
* core, core/vm, core/state: remove unused functionsGustav Simonsson2015-09-111-17/+0
|
* Add tests for uncle timestamps and refactor timestamp typeGustav Simonsson2015-08-254-4/+4
|
* cmd/evm, core/vm, tests: changed DisableVm to EnableVmJeffrey Wilcke2015-08-123-5/+5
|
* core/vm: fixed jit error & added inline docsJeffrey Wilcke2015-08-112-11/+14
| | | | | opNumber did not create a new big int which could lead to the block's number being modified.
* cmd/geth, core/vm: setup vm settings and defaulted JIT disabledJeffrey Wilcke2015-08-091-3/+3
|
* core/vm: reduced big int allocationsJeffrey Wilcke2015-08-073-122/+77
| | | | | | | Reduced big int allocation by making stack items modifiable. Instead of adding items such as `common.Big0` to the stack, `new(big.Int)` is added instead. One must expect that any item that is added to the stack might change.
* core, tests: reduced state copy by N callsJeffrey Wilcke2015-08-075-1/+8
| | | | | 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-079-64/+1356
| | | | * changed stack and removed stack ptr. Let go decide on slice reuse.
* all: fix license headers one more timeFelix Lange2015-07-2417-17/+17
| | | | I forgot to update one instance of "go-ethereum" in commit 3f047be5a.
* all: update license headers to distiguish GPL/LGPLFelix Lange2015-07-2317-68/+68
| | | | | All code outside of cmd/ is licensed as LGPL. The headers now reflect this by calling the whole work "the go-ethereum library".
* core/vm: added str to opJeffrey Wilcke2015-07-091-0/+136
|
* all: goimports -wFelix Lange2015-07-071-2/+4
|
* all: add some godoc synopsis commentsFelix Lange2015-07-071-0/+1
|
* all: update license informationFelix Lange2015-07-0717-0/+272
|
* core, miner: removed vm errors from consensus err checkingJeffrey Wilcke2015-07-061-1/+1
| | | | | Removed VM errors from the consensus errors. They now used for output only.
* Fix core error forwarding, unify OOG VM errGustav Simonsson2015-07-042-23/+5
|
* Use uint64 for block header timestampGustav Simonsson2015-06-302-2/+2
|
* core/vm: clarified SSTOREobscuren2015-06-181-7/+5
|
* core, core/vm: state improvements and tx pool speed upobscuren2015-06-171-15/+6
| | | | Removed full tx validation during state transitions
* core: TMP testing codeobscuren2015-06-171-6/+15
|
* core/state, core/vm: reworked storage get / set to use common.Hashobscuren2015-06-171-4/+11
|
* core/state, core/vm: cleanup refundsobscuren2015-06-171-2/+2
|
* core/vm: Improved error reporting for trace loggingobscuren2015-06-124-46/+45
|
* core/vm: fixed printable characters using unicode insteadobscuren2015-06-121-2/+2
|
* core/vm: added a comment regarding the uint64 vs *big.Intobscuren2015-06-111-1/+3
|
* core/vm: reverse loop stackobscuren2015-06-111-2/+3
|
* core/vm: fixed a bug where `Data` ignored the stack ptrobscuren2015-06-111-1/+1
|
* core, core/vm: moved logger and added gas cost to struct loggingobscuren2015-06-113-4/+50
|
* core/vm: unexported stack again. No longer requiredobscuren2015-06-103-16/+16
|
* core/vm: documentation and name changesobscuren2015-06-102-18/+34
|
* core/vm, core/state: added storage to structured vm loggingobscuren2015-06-102-8/+16
|
* core, core/vm: added structure loggingobscuren2015-06-105-147/+40
| | | | This also reduces the time required spend in the VM
* core/vm: added structured loggingobscuren2015-06-101-4/+22
|
* core/vm: changed program counter to uint64obscuren2015-06-102-13/+13
|
* Remove unneeded if check on EC recover paddingGustav Simonsson2015-06-091-3/+1
|
* Pad precompiled EC recover input and add validationsGustav Simonsson2015-06-091-8/+14
|
* core/vm: cleanup and renamesobscuren2015-06-045-52/+0
|
* core/vm: check for 'no code' before doing any workFelix Lange2015-06-031-5/+5
|
* core/vm: improve JUMPDEST analysisFelix Lange2015-06-033-25/+44
| | | | | | | | | * JUMPDEST analysis is faster because less type conversions are performed. * The map of JUMPDEST locations is now created lazily at the first JUMP. * The result of the analysis is kept around for recursive invocations through CALL/CALLCODE. Fixes #1147
* core/vm: Fork fix. Removal of appending 0 bytes in memsetobscuren2015-05-261-6/+2
|
* Merge pull request #1101 from obscuren/issue-1096Jeffrey Wilcke2015-05-261-15/+3
|\ | | | | core/vm: Cleanups & SUB output fix. Closes #1096
| * core/vm: Cleanups & SUB output fix. Closes #1096obscuren2015-05-261-15/+3
| |
* | core/vm, rpc: added disasm to `ext_` RPCobscuren2015-05-221-0/+21
|/
* core/vm: RETURN op code returns pointer to memory rather than copyobscuren2015-05-202-1/+13
|
* Changed how logs are being recordedobscuren2015-04-082-2/+3
| | | | | | | Logs are now recorded per transactions instead of tossing them out after each transaction. This should also fix an issue with `eth_getFilterLogs` (#629) Also now implemented are the `transactionHash, blockHash, transactionIndex, logIndex` on logs. Closes #654.
* Use logger.Error instead of 0 with glogGustav Simonsson2015-04-071-1/+2
|
* Forward and log EC recover err and remove dup pubkey len checkGustav Simonsson2015-04-071-2/+4
|
* basic glogobscuren2015-04-042-11/+6
|
* bool => intobscuren2015-04-031-63/+63
|
* fixed stack levelobscuren2015-04-031-3/+4
|
* Read most protocol params from common/params.jsonGustav Simonsson2015-04-027-81/+46
| | | | | | | | | * Add params package with exported variables generated from github.com/ethereum/common/blob/master/params.json * Use params package variables in applicable places * Add check for minimum gas limit in validation of block's gas limit * Remove common/params.json from go-ethereum to avoid outdated version of it
* sha3 stack checkobscuren2015-04-011-1/+1
|
* Check stack for BALANCE. Closes #622obscuren2015-04-011-1/+1
|
* Blocktest fixed, Execution fixedobscuren2015-04-011-1/+2
| | | | | | * Added new CreateAccount method which properly overwrites previous accounts (excluding balance) * Fixed block tests (100% success)
* Cleanup.obscuren2015-03-291-10/+13
|
* Merge branch 'fix_ecrecover' of https://github.com/ebuchman/go-ethereum into ↵obscuren2015-03-291-7/+21
| | | | ebuchman-fix_ecrecover
* Cleanup VM.obscuren2015-03-294-56/+45
| | | | | | | * CALLDATA use getData * removed old context get range value * removed casting big => int for some cases * pc now big int #457
* Cleanup VMobscuren2015-03-293-10/+22
|
* PUSH gas fixobscuren2015-03-272-21/+5
|
* Removed commentsobscuren2015-03-271-15/+0
|
* Removed defer/panic. #503obscuren2015-03-274-120/+180
|
* Explicitly check memory's data store. #515obscuren2015-03-271-1/+8
|
* Stack limitobscuren2015-03-271-0/+6
|
* Cleaned up changesobscuren2015-03-242-3/+2
|
* Modified according to poc 9 changesobscuren2015-03-241-1/+1
| | | | * Refund of value
* Decrement depthobscuren2015-03-241-1/+3
|
* moved state and vm to coreobscuren2015-03-2317-0/+2384