aboutsummaryrefslogtreecommitdiffstats
path: root/core/state
Commit message (Collapse)AuthorAgeFilesLines
* state: take write lock in GetNonce (#3625)Brian Schroeder2017-02-011-3/+5
| | | | We must take a write lock here because `GetNonce` calls `StateDB.GetStateObject`, which mutates the DB's live set.
* cmd/geth, core: add support for recording SHA3 preimages (#3543)Nick Johnson2017-01-172-1/+32
|
* all: fix ineffectual assignments and remove uses of crypto.Sha3Felix Lange2017-01-091-4/+4
| | | | | go get github.com/gordonklaus/ineffassign ineffassign .
* all: fix spelling errorsPéter Szilágyi2017-01-071-1/+1
|
* all: fix issues reported by honnef.co/go/simple/cmd/gosimpleFelix Lange2017-01-072-3/+3
|
* all: gofmt -w -sFelix Lange2017-01-064-9/+9
|
* trie: remove dependency on ethdbFelix Lange2017-01-062-9/+8
| | | | This removes the core/types -> leveldb dependency.
* core/vm: move Log to core/typesFelix Lange2017-01-062-12/+13
| | | | | | | | This significantly reduces the dependency closure of ethclient, which no longer depends on core/vm as of this change. All uses of vm.Logs are replaced by []*types.Log. NewLog is gone too, the constructor simply returned a literal.
* core, core/vm: implemented a generic environment (#3348)Jeffrey Wilcke2016-12-062-1/+10
| | | | | | | | 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: fixed consensus issue added touch revertJeffrey Wilcke2016-11-253-2/+51
| | | | | Implemented proper touch revert journal entries and copied a Parity consensus bug in order to remain in sync with the current longest chain.
* cmd/geth, core, light, mobile: removed state account StartingNonceJeffrey Wilcke2016-11-231-6/+2
| | | | All account's nonce start at 0.
* core, core/state, trie: EIP158, reprice & skip empty account writeJeffrey Wilcke2016-11-135-18/+38
| | | | | | | | | | | | | | | 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, eth/downloader, trie: reset fast-failure on progressPéter Szilágyi2016-10-312-7/+9
|
* cmd/geth, trie: report on trie cache unloads, also add debug logPéter Szilágyi2016-10-191-0/+2
|
* cmd, core/state: allow configurable trie cache generationsPéter Szilágyi2016-10-191-5/+5
|
* core/state: bump trie cache values slightlyFelix Lange2016-10-181-4/+4
|
* trie, core/state: improve memory usage and performance (#3135)Felix Lange2016-10-152-6/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * trie: store nodes as pointers This avoids memory copies when unwrapping node interface values. name old time/op new time/op delta Get 388ns ± 8% 215ns ± 2% -44.56% (p=0.000 n=15+15) GetDB 363ns ± 3% 202ns ± 2% -44.21% (p=0.000 n=15+15) UpdateBE 1.57µs ± 2% 1.29µs ± 3% -17.80% (p=0.000 n=13+15) UpdateLE 1.92µs ± 2% 1.61µs ± 2% -16.25% (p=0.000 n=14+14) HashBE 2.16µs ± 6% 2.18µs ± 6% ~ (p=0.436 n=15+15) HashLE 7.43µs ± 3% 7.21µs ± 3% -2.96% (p=0.000 n=15+13) * trie: close temporary databases in GetDB benchmark * trie: don't keep []byte from DB load around Nodes decoded from a DB load kept hashes and values as sub-slices of the DB value. This can be a problem because loading from leveldb often returns []byte with a cap that's larger than necessary, increasing memory usage. * trie: unload old cached nodes * trie, core/state: use cache unloading for account trie * trie: use explicit private flags (fixes Go 1.5 reflection issue). * trie: fixup cachegen overflow at request of nick * core/state: rename journal size constant
* core/state: optimize GetStateFelix Lange2016-10-061-5/+7
| | | | There is no need to use the reflection-based decoder to decode []byte.
* core/state: rename Delete/IsDeleted to Suicide/HasSuicidedFelix Lange2016-10-065-27/+27
| | | | The delete/remove naming has caused endless confusion in the past.
* core/state: implement reverts by journaling all changesFelix Lange2016-10-068-143/+584
| | | | | | | | | | 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!
* core/state: track dirty state entries for each objectPéter Szilágyi2016-10-032-18/+24
|
* cmd, core, internal, light, tests: avoid hashing the code in the VMPéter Szilágyi2016-10-015-11/+22
|
* core, eth, trie: reuse trie journals in all our codePéter Szilágyi2016-09-281-9/+42
|
* core, trie: replace state caches with trie journalFelix Lange2016-09-284-63/+69
|
* core/state: track all accounts in canon stateFelix Lange2016-09-266-295/+367
| | | | | This change introduces a global, per-state cache that keeps account data in the canon state. Thanks to @karalabe for lots of fixes.
* core/state: short-circuit balance change if zero valueGustav Simonsson2016-09-261-0/+6
|
* core/state, light: remove unused StateObject.initCodeGustav Simonsson2016-09-192-6/+0
|
* core/state: Fix memory expansion bug by not copying clean objectsNick Johnson2016-09-193-5/+8
|
* Revert "test, cmd/evm, core, core/vm: illegal code hash implementation"Péter Szilágyi2016-06-291-10/+0
| | | | This reverts commit 7a5b571c671e70e0e4807cf971c15e2d1e09d33d.
* Revert "core: update DAO soft-fork number, clean up the code"Péter Szilágyi2016-06-291-0/+2
| | | | This reverts commit ba784bdf36f2daf7827ec1ec864f3393ba8d86a0.
* core: update DAO soft-fork number, clean up the codePéter Szilágyi2016-06-231-2/+0
|
* test, cmd/evm, core, core/vm: illegal code hash implementationJeffrey Wilcke2016-06-221-0/+10
| | | | | | | | 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.
* core/state, eth: Updated suicides objects when tracing transactionsJeffrey Wilcke2016-06-131-0/+21
| | | | | | | | | | | | | | | | | | | | | | Consensus rules dictate that objects can only be removed during the finalisation of the transaction (i.e. after all calls have finished). Thus calling a suicided contract twice from the same transaction: A->B(S)->ret(A)->B(S) results in 2 suicides. Calling the suicided object twice from two transactions: A->B(S), A->B, results in only one suicide and a call to an empty object. Our current debug tracing functionality replays all transaction that were executed prior to the targetted transaction in order to provide the user with an accurate trace. As a side effect to calling StateDB.IntermediateRoot it also deletes any suicides objects. Our tracing code never calls this function because it isn't interested in the intermediate root. Becasue of this it caused a bug in the tracing code where transactions that were send to priviously deleted objects resulted in two suicides rather than one suicide and a call to an empty object. Fixes #2542
* Merge pull request #2585 from karalabe/trie-dirty-trackingJeffrey Wilcke2016-05-311-0/+22
|\ | | | | core, core/state, trie: enterprise hand-tuned multi-level caching
| * core, core/state, trie: enterprise hand-tuned multi-level cachingPéter Szilágyi2016-05-261-0/+22
| |
* | core/state: return the starting nonce for non-existent accs (testnet)Péter Szilágyi2016-05-271-1/+1
|/
* all: fix go vet warningsFelix Lange2016-04-151-5/+5
|
* core/state: fix TestDumpFelix Lange2016-04-153-9/+27
| | | | Lazy "I'll just put return here instead of fixing the test" found by go vet.
* all: update license informationFelix Lange2016-04-152-2/+2
|
* core: Added EVM configuration optionsJeffrey Wilcke2016-03-241-18/+15
| | | | | The EVM is now initialised with an additional configured object that allows you to turn on debugging options.
* core: various typosLeif Jurvetson2016-03-162-2/+2
|
* Merge pull request #2242 from jimenezrick/upstream-cryptoJeffrey Wilcke2016-02-241-2/+2
|\ | | | | Closes #2241: Use Keccak-256 from golang.org/x/crypto/sha3 and mention explicitly
| * all: Rename crypto.Sha3{,Hash}() to crypto.Keccak256{,Hash}()Ricardo Catalinas Jiménez2016-02-221-2/+2
| | | | | | | | As we aren't really using the standarized SHA-3
* | Merge pull request #2095 from karalabe/trie-node-iteratorPéter Szilágyi2016-02-233-3/+314
|\ \ | |/ |/| core/state, trie: add node iterator, test state/trie sync consistency
| * core/state, trie: switch iterator panics to error fieldsPéter Szilágyi2016-02-162-26/+37
| |
| * core/state, trie: node iterator reports parent hashes tooPéter Szilágyi2016-02-161-7/+13
| |
| * core/state, trie: surface iterator entry hashesPéter Szilágyi2016-02-163-7/+67
| |
| * core/state, trie: add node iterator, test state/trie sync consistencyPéter Szilágyi2016-02-162-3/+237
| |
* | core, core/vm, crypto: fixes for homesteadJeffrey Wilcke2016-02-183-24/+3
| | | | | | | | | | | | * 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-182-0/+29
|/ | | | | | | | * 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, ethdb, trie: test intermediate secure key leak, fix memdb bugPéter Szilágyi2016-01-201-0/+68
|
* core/state, trie: don't leak database writes before commitPéter Szilágyi2016-01-202-3/+59
|
* core/state: always commit in batches, just finish if not needed laterPéter Szilágyi2016-01-131-1/+2
|
* core, eth/downloader: ensure state presence in ancestor lookupPéter Szilágyi2016-01-041-1/+0
|
* core/state, core/types use package rlp for state, receipt serialisationFelix Lange2015-12-184-62/+61
|
* Merge pull request #1889 from karalabe/fast-sync-rebaseJeffrey Wilcke2015-10-222-0/+308
|\ | | | | eth/63 fast synchronization algorithm
| * core, eth, trie: fix data races and merge/review issuesPéter Szilágyi2015-10-212-4/+3
| |
| * eth/downloader: concurrent receipt and state processingPéter Szilágyi2015-10-192-68/+41
| |
| * core, eth, trie: direct state trie synchronizationPéter Szilágyi2015-10-192-0/+336
| |
* | core, core/state: move gas tracking out of core/stateFelix Lange2015-10-173-80/+1
|/ | | | | | | 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.
* core/state, core, miner: handle missing root error from state.NewGustav Simonsson2015-10-163-9/+9
|
* cmd, core, eth: added official testnetJeffrey Wilcke2015-10-091-0/+5
|
* cmd/evm, core/vm, test: refactored VM and coreJeffrey Wilcke2015-10-042-80/+27
| | | | | | | | | | | | | | | | | * 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/state: batch-based state syncFelix Lange2015-09-233-51/+46
|
* core, trie: new trieFelix Lange2015-09-232-14/+25
|
* all: move common.Database to package ethdbFelix Lange2015-09-152-5/+7
|
* core, core/vm, core/state: remove unused functionsGustav Simonsson2015-09-112-64/+0
|
* core/state: test formatting adhering to Go conventionGustav Simonsson2015-09-091-17/+17
|
* core/state: deleted field in StateObject Copy() and unit testGustav Simonsson2015-09-082-0/+105
|
* core, tests: Double SUICIDE fixJeffrey Wilcke2015-08-212-9/+12
|
* core/state: Set log index. Closes #1226Jeffrey Wilcke2015-07-291-0/+5
|
* all: fix license headers one more timeFelix Lange2015-07-249-9/+9
| | | | I forgot to update one instance of "go-ethereum" in commit 3f047be5a.
* all: update license headers to distiguish GPL/LGPLFelix Lange2015-07-239-36/+36
| | | | | 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: update license informationFelix Lange2015-07-079-0/+144
|
* core, miner, tests: renamed state methodsJeffrey Wilcke2015-07-042-3/+5
| | | | | | | | | | | | * Update => SyncIntermediate * Added SyncObjects SyncIntermediate only updates whatever has changed, but, as a side effect, requires much more disk space. SyncObjects will only sync whatever is required for a block and will not save intermediate state to disk. As drawback this requires more time when more txs come in.
* core, core/state: only write necessary state. Skip intermediateJeffrey Wilcke2015-07-042-10/+20
|
* core, miner, xeth: renamed gas methodsobscuren2015-06-211-16/+3
| | | | | | * BuyGas => SubGas * RefundGas => AddGas * SetGasPool => SetGasLimit
* core/state: removed trie copyobscuren2015-06-171-1/+1
|
* core/state: removed state from state objectobscuren2015-06-173-31/+20
|
* core/state: fixed state testsobscuren2015-06-171-13/+10
|
* core/state: remove the need for common.Valueobscuren2015-06-171-2/+4
|
* core/state, core/vm: reworked storage get / set to use common.Hashobscuren2015-06-172-32/+25
|
* core/state, core/vm: cleanup refundsobscuren2015-06-171-14/+8
|
* core/vm, core/state: added storage to structured vm loggingobscuren2015-06-101-0/+16
|
* core, xeth: moved nonce management burden from xeth to txpoolobscuren2015-06-101-1/+1
|
* core: fixed an issue with storing receiptsobscuren2015-05-281-7/+14
|
* solidity compiler and contract metadocs integrationzelig2015-05-071-0/+3
| | | | | | | | | | | | | * common/compiler: solidity compiler + tests * rpc: eth_compilers, eth_compileSolidity + tests * fix natspec test using keystore API, notice exp dynamically changes addr, cleanup * resolver implements registrars and needs to create reg contract (temp) * xeth: solidity compiler. expose getter Solc() and paths setter SetSolc(solcPath) * ethereumApi: implement compiler related RPC calls using XEth - json struct tests * admin: make use of XEth.SetSolc to allow runtime setting of compiler paths * cli: command line flags solc to set custom solc bin path * js admin api with new features debug and contractInfo modules * wiki is the doc https://github.com/ethereum/go-ethereum/wiki/Contracts-and-Transactions
* core: removed nonce resetting from the block processor.obscuren2015-04-211-0/+1
| | | | All nonce error handling has been moved to the worker
* state: fixed mutex lockesobscuren2015-04-141-2/+14
|
* state: fixed nonce issue in managed stateobscuren2015-04-141-2/+2
| | | | Rlock => Lock when creating a new nonce
* Moved handling of nonces to the managed stateobscuren2015-04-092-5/+8
|
* Improved transaction poolobscuren2015-04-091-8/+4
| | | | | | | | | | 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
* Changed how logs are being recordedobscuren2015-04-082-81/+49
| | | | | | | 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.
* Added additional methods to the managed stateobscuren2015-04-082-2/+44
| | | | | * GetNonce Returns the canonical nonce * SetNonce Set the managed account's nonce
* Moved logging to logger.Coreobscuren2015-04-042-5/+5
|
* basic glogobscuren2015-04-042-7/+16
|
* glog wipobscuren2015-04-031-1/+4
|
* Removed old (unused) argumentobscuren2015-04-022-2/+2
|
* fixed testsobscuren2015-04-011-1/+1
|
* Blocktest fixed, Execution fixedobscuren2015-04-011-26/+42
| | | | | | * Added new CreateAccount method which properly overwrites previous accounts (excluding balance) * Fixed block tests (100% success)
* Secure trie shakey / key matchingobscuren2015-03-241-4/+4
|
* moved state and vm to coreobscuren2015-03-239-0/+1159