aboutsummaryrefslogtreecommitdiffstats
path: root/core/state_transition.go
Commit message (Collapse)AuthorAgeFilesLines
* core/vm: improved EVM run loop & instruction calling (#3378)Jeffrey Wilcke2017-01-051-5/+5
| | | | | | | | | | | | | | | 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-27/+24
| | | | | | | | 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-28/+11
|
* core, core/state, trie: EIP158, reprice & skip empty account writeJeffrey Wilcke2016-11-131-2/+2
| | | | | | | | | | | | | | | 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: added CheckNonce() to Message interfacezsfelfoldi2016-07-111-2/+5
|
* core: transition db now also returns the required gas amountJeffrey Wilcke2016-04-011-7/+24
| | | | | | | | | Exposes some core methods to transition and compute new state information and adds an additional return value to the transition db method to fetch required gas for that particular message (excluding gas refunds from any SSTORE[X] = 0 and SUICIDE. Fixes #2395
* core: added basic chain configurationJeffrey Wilcke2016-04-011-2/+2
| | | | | | | | | 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-5/+1
| | | | | The EVM is now initialised with an additional configured object that allows you to turn on debugging options.
* Merge pull request #2215 from bas-vk/estimategasPéter Szilágyi2016-03-011-1/+1
|\ | | | | core: improved check for contract creation
| * core: improved check for contract creationBas van Kervel2016-02-161-1/+1
| |
* | core, core/vm, crypto: fixes for homesteadJeffrey Wilcke2016-02-181-27/+12
| | | | | | | | | | | | * 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-181-6/+39
|/ | | | | | | | * 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, core/state: move gas tracking out of core/stateFelix Lange2015-10-171-23/+27
| | | | | | | The amount of gas available for tx execution was tracked in the StateObject representing the coinbase account. This commit makes the gas counter a separate type in package core, which avoids unintended consequences of intertwining the counter with state logic.
* cmd/evm, core/vm, test: refactored VM and coreJeffrey Wilcke2015-10-041-31/+36
| | | | | | | | | | | | | | | | | * 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: improve block gas trackingFelix Lange2015-09-021-15/+8
|
* all: fix license headers one more timeFelix Lange2015-07-241-1/+1
| | | | I forgot to update one instance of "go-ethereum" in commit 3f047be5a.
* all: update license headers to distiguish GPL/LGPLFelix Lange2015-07-231-4/+4
| | | | | All code outside of cmd/ is licensed as LGPL. The headers now reflect this by calling the whole work "the go-ethereum library".
* all: update license informationFelix Lange2015-07-071-0/+16
|
* core, miner: removed vm errors from consensus err checkingJeffrey Wilcke2015-07-061-0/+7
| | | | | Removed VM errors from the consensus errors. They now used for output only.
* Fix core error forwarding, unify OOG VM errGustav Simonsson2015-07-041-1/+1
|
* core, xeth: core.AddressFromMessage removed => crypto.CreateAddressJeffrey Wilcke2015-07-021-6/+0
|
* core: remove superfluous big.Int allocationsFelix Lange2015-06-301-25/+13
| | | | | With blocks now being immutable, use big.Int values from accessor functions instead of copying their results.
* core: avoid duplicate calls to Transaction.DataFelix Lange2015-06-301-3/+3
|
* core: optimize IntrinsicGasFelix Lange2015-06-301-5/+12
|
* core/types: make blocks immutableFelix Lange2015-06-301-4/+5
|
* core, miner, xeth: renamed gas methodsobscuren2015-06-211-13/+2
| | | | | | * BuyGas => SubGas * RefundGas => AddGas * SetGasPool => SetGasLimit
* core/state, core/vm: cleanup refundsobscuren2015-06-171-5/+3
|
* core, core/vm: moved logger and added gas cost to struct loggingobscuren2015-06-111-1/+1
|
* core, core/vm: added structure loggingobscuren2015-06-101-0/+4
| | | | This also reduces the time required spend in the VM
* Add missing err checks on From() (skip RPC for now)Gustav Simonsson2015-06-021-15/+20
|
* Update StateTests and nil create return on failed code depositGustav Simonsson2015-05-161-0/+1
|
* Improved transaction poolobscuren2015-04-091-16/+15
| | | | | | | | | | The transaction pool will now some easily be able to pre determine the validity of a transaction by checking the following: * Account existst * gas limit higher than the instrinsic gas * enough funds to pay upfront costs * nonce check
* Moved logging to logger.Coreobscuren2015-04-041-4/+3
|
* Read most protocol params from common/params.jsonGustav Simonsson2015-04-021-4/+5
| | | | | | | | | * 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
* Blocktest fixed, Execution fixedobscuren2015-04-011-4/+5
| | | | | | * Added new CreateAccount method which properly overwrites previous accounts (excluding balance) * Fixed block tests (100% success)
* Cleaned up changesobscuren2015-03-241-5/+2
|
* Modified according to poc 9 changesobscuren2015-03-241-1/+1
| | | | * Refund of value
* Updated for PV59obscuren2015-03-241-8/+7
| | | | * Value XFER are refunded back to the sender if the execution fails
* moved state and vm to coreobscuren2015-03-231-2/+2
|
* conversions. -compilable-obscuren2015-03-181-0/+6
|
* Fixed VM & Tests w/ conversionobscuren2015-03-171-10/+9
|
* core: actually convert transaction poolFelix Lange2015-03-171-10/+9
|
* Merge remote-tracking branch 'ethereum/conversion' into conversionFelix Lange2015-03-171-9/+13
|\
| * converted vmobscuren2015-03-171-9/+13
| |
* | core: adapt Message for new Transaction.From signatureFelix Lange2015-03-171-2/+3
|/
* updated vm envobscuren2015-03-171-3/+3
|
* Moved ethutil => commonobscuren2015-03-161-4/+4
|
* Return proper errorobscuren2015-03-141-0/+3
|
* Removed some of that gas pre pay magicobscuren2015-03-131-22/+25
|
* Lowered default gas price and increased default gas limitobscuren2015-03-121-0/+2
|
* Improved error reporting and removed commented codeobscuren2015-03-111-32/+1
|
* Merge ethereum/poc-9 into accounts-integrationFelix Lange2015-03-101-3/+9
|\ | | | | | | | | | | | | | | | | | | Conflicts: cmd/utils/cmd.go cmd/utils/flags.go core/manager.go eth/backend.go rpc/http/server.go xeth/xeth.go
| * Spec changes.obscuren2015-03-061-3/+10
| | | | | | | | * All errors during state transition result in an invalid tx
* | core: remove Hash method from Message interfaceFelix Lange2015-03-101-3/+2
|/ | | | This will simplify the next commmit. Hash was only used for logging.
* Fixed error for invalid transactionobscuren2015-03-031-7/+6
|
* Updated gast costsobscuren2015-03-031-8/+4
|
* New gas prices modelobscuren2015-03-021-3/+9
|
* Bumpobscuren2015-02-271-4/+1
|
* Fixed consensus issue for refundingobscuren2015-02-271-3/+6
| | | | * Refund should _always_ go to the origin
* Removed exported fields from state object and added proper set/gettersobscuren2015-02-201-4/+4
|
* Optimisations and fixed a couple of DDOS issues in the minerobscuren2015-02-201-1/+2
|
* Docs & old code removedobscuren2015-02-031-21/+25
|
* Added (disabled) Jit validationobscuren2015-02-011-0/+25
|
* Fixed consensus issueobscuren2015-01-131-2/+1
|
* Changed prev_hash to block_hash, state transition now uses vm envobscuren2015-01-041-20/+21
| | | | | | | * PREVHASH => BLOCKHASH( N ) * State transition object uses VMEnv as it's query interface * Updated vm.Enviroment has GetHash( n ) for BLOCKHASH instruction * Added GetHash to xeth, core, utils & test environments
* Closure => Contextobscuren2015-01-021-1/+1
|
* Minor updates on gas and removed/refactored old code.obscuren2014-12-201-11/+10
|
* Removed OOG check. Revert should always happen.obscuren2014-12-191-2/+9
|
* Transaction was generating incorrect hash because of var changesobscuren2014-12-191-1/+1
|
* Fixed refund modelobscuren2014-12-191-6/+4
|
* Gas corrections and vm fixesobscuren2014-12-191-36/+37
|
* Moved methods to messagesobscuren2014-12-181-4/+6
|
* Created generic message (easy for testing)obscuren2014-12-181-32/+66
|
* null ptr fixobscuren2014-12-041-4/+3
|
* Renamed State => StateDBobscuren2014-12-041-3/+3
|
* Renamed `chain` => `core`obscuren2014-12-041-0/+198