aboutsummaryrefslogtreecommitdiffstats
path: root/core/state_transition.go
Commit message (Collapse)AuthorAgeFilesLines
* core: make txpool operate on immutable statePéter Szilágyi2017-09-051-3/+5
|
* core: implement Metropolis EIP 658, receipt status byterjl4934564422017-08-221-10/+9
|
* core: Fix VM error loggingLewis Marshall2017-06-061-1/+1
| | | | Signed-off-by: Lewis Marshall <lewis@lmars.net>
* core: typos and comments improvechanghong2017-05-251-51/+52
| | | | | | | | 1. fix typos 2. methods recevier of struct should be same 3. comments improve (cherry picked from commit 1ba979539582a00b7fd1a7c8a37a6852e59eac0d)
* core: fix processing regression during receipt importPéter Szilágyi2017-05-081-5/+1
|
* consensus, core: drop all the legacy custom core error typesPéter Szilágyi2017-04-061-17/+7
|
* all: next batch of log polishes to contextual versionsPéter Szilágyi2017-02-281-2/+1
|
* common: move big integer math to common/math (#3699)Felix Lange2017-02-271-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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/+3
|
* core, core/state, core/vm: remove exported account getters (#3618)Jeffrey Wilcke2017-02-231-15/+20
| | | | Removed exported statedb object accessors, reducing the chance for nasty bugs to creep in. It's also ugly and unnecessary to have these methods.
* logger: remove Core verbosity level (#3659)Felix Lange2017-02-151-1/+1
|
* params: core, core/vm, miner: 64bit gas instructionsJeffrey Wilcke2017-02-141-38/+50
| | | | | | | | | | | | | | | | | 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-50/+38
| | | | This reverts commit 8b57c494908637a5c0e74f8f7a13b3218e026757.
* params: core, core/vm, miner: 64bit gas instructions (#3514)Jeffrey Wilcke2017-02-021-38/+50
| | | | | | | | | | | | | | | | 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
* core: removal of dead-codeJeffrey Wilcke2017-01-181-3/+0
| | | | | | Removal of dead code that appeard as if we had a consensus issue. This however is not the case as the proper error catching happens in the vm package instead.
* 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