aboutsummaryrefslogtreecommitdiffstats
path: root/core/state/statedb.go
Commit message (Collapse)AuthorAgeFilesLines
* Rebrand as tangerine-network/go-tangerineWei-Ning Huang2019-09-171-7/+7
|
* Change import go github.com/dexon-foundation/dexonWei-Ning Huang2019-06-121-7/+7
|
* core/state: rename 'new' variable (#18301)Shuai Qi2018-12-141-2/+2
|
* core/state: remove lock (#18065)Felix Lange2018-11-091-6/+0
| | | | The lock in StateDB is useless. It's only held in Copy, but Copy is safe for concurrent use because all it does is read.
* core/state: simplify proof methods (#17965)Felix Lange2018-10-241-7/+13
| | | | This fixes the import cycle build error in core/vm tests. There is no need to refer to core/vm for a type definition.
* EIP-1186 eth_getProof (#17737)Simon Jentzsch2018-10-191-0/+20
| | | | | | | | | | | | | | | | * first impl of eth_getProof * fixed docu * added comments and refactored based on comments from holiman * created structs * handle errors correctly * change Value to *hexutil.Big in order to have the same output as parity * use ProofList as return type
* core, params: polish net gas metering PR a bitPéter Szilágyi2018-09-181-13/+10
|
* core,state: finish implementing Eip 1283Martin Holst Swende2018-09-181-0/+8
|
* core, state: initial implementation of Eip-1283Martin Holst Swende2018-09-181-0/+11
|
* core/statedb: deep copy logs (#17489)gary rong2018-08-231-3/+6
|
* trie: cache collapsed tries node, not rlp blobs (#16876)Péter Szilágyi2018-06-211-1/+1
| | | | | | | | | | | | The current trie memory database/cache that we do pruning on stores trie nodes as binary rlp encoded blobs, and also stores the node relationships/references for GC purposes. However, most of the trie nodes (everything apart from a value node) is in essence just a collection of references. This PR switches out the RLP encoded trie blobs with the collapsed-but-not-serialized trie nodes. This permits most of the references to be recovered from within the node data structure, avoiding the need to track them a second time (expensive memory wise).
* core, consensus: fix some typos in comment code and output loghadv2018-05-191-1/+1
|
* core, eth: fix tracer dirty finalizationPéter Szilágyi2018-04-271-21/+0
|
* core/state: fix ripemd-cornercase in CopyMartin Holst Swende2018-04-111-2/+8
|
* core/state: fix bug in copy of copy StateMartin Holst Swende2018-04-111-0/+10
|
* state: handle nil in journal dirtiesMartin Holst Swende2018-04-101-1/+11
|
* core/state: avoid linear overhead on journal dirty listingPéter Szilágyi2018-03-281-21/+14
|
* core/state: rework dirty handling to avoid quadratic overheadMartin Holst Swende2018-03-281-25/+27
|
* core/state: uniform parameter style (#16398)Jia Chenhui2018-03-281-10/+10
| | | - Uniform code style.
* core/state: fix typo (#16370)Jia Chenhui2018-03-261-2/+2
|
* core, trie: intermediate mempool between trie and database (#15857)Péter Szilágyi2018-02-061-7/+31
| | | This commit reduces database I/O by not writing every state trie to disk.
* all: switch gas limits from big.Int to uint64Péter Szilágyi2018-01-031-10/+7
|
* core/state: copy trie too, not just contentPéter Szilágyi2017-11-241-1/+1
|
* core/state: revert metro suicide map addition (#15024)Péter Szilágyi2017-08-241-42/+27
|
* core/state: access trie through Database interface, track errors (#14589)Felix Lange2017-06-271-107/+32
| | | | | | | | | With this commit, core/state's access to the underlying key/value database is mediated through an interface. Database errors are tracked in StateDB and returned by CommitTo or the new Error method. Motivation for this change: We can remove the light client's duplicated copy of core/state. The light client now supports node iteration, so tracing and storage enumeration can work with the light client (not implemented in this commit).
* core/state: fixed (self)destructed objectsJeffrey Wilcke2017-05-181-0/+2
| | | | | | Add the object to the list of destructed objects during a selfdestruct / suicide operation and also remove it from the list once the journal reverts.
* consensus, core/*, params: metropolis preparation refactorJeffrey Wilcke2017-05-181-34/+57
| | | | | | | | | | | | | | | | | | | | | | | | This commit is a preparation for the upcoming metropolis hardfork. It prepares the state, core and vm packages such that integration with metropolis becomes less of a hassle. * Difficulty calculation requires header instead of individual parameters * statedb.StartRecord renamed to statedb.Prepare and added Finalise method required by metropolis, which removes unwanted accounts from the state (i.e. selfdestruct) * State keeps record of destructed objects (in addition to dirty objects) * core/vm pre-compiles may now return errors * core/vm pre-compiles gas check now take the full byte slice as argument instead of just the size * core/vm now keeps several hard-fork instruction tables instead of a single instruction table and removes the need for hard-fork checks in the instructions * core/vm contains a empty restruction function which is added in preparation of metropolis write-only mode operations * Adds the bn256 curve * Adds and sets the metropolis chain config block parameters (2^64-1)
* eth: add debug_storageRangeAtFelix Lange2017-04-251-0/+11
|
* trie: add start key to NodeIterator constructorsFelix Lange2017-04-251-1/+1
| | | | | | | | | The 'step' method is split into two parts, 'peek' and 'push'. peek returns the next state but doesn't make it current. The end of iteration was previously tracked by setting 'trie' to nil. End of iteration is now tracked using the 'iteratorEnd' error, which is slightly cleaner and requires less code.
* trie: clean up iterator constructorsFelix Lange2017-04-251-1/+1
| | | | | | | Make it so each iterator has exactly one public constructor: - NodeIterators can be created through a method. - Iterators can be created through NewIterator on any NodeIterator.
* core/state: expose CommitToFelix Lange2017-03-231-2/+3
|
* core/state: drop most of a logs (useless at this volume)Péter Szilágyi2017-02-281-5/+2
|
* all: blidly swap out glog to our log15, logs need reworkPéter Szilágyi2017-02-231-7/+6
|
* core, core/state, core/vm: remove exported account getters (#3618)Jeffrey Wilcke2017-02-231-31/+46
| | | | 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
|
* cmd/geth, core: add support for recording SHA3 preimages (#3543)Nick Johnson2017-01-171-1/+25
|
* all: fix spelling errorsPéter Szilágyi2017-01-071-1/+1
|
* all: gofmt -w -sFelix Lange2017-01-061-3/+3
|
* core/vm: move Log to core/typesFelix Lange2017-01-061-10/+11
| | | | | | | | 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-061-0/+9
| | | | | | | | 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.
* 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-131-9/+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>
* 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-151-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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: rename Delete/IsDeleted to Suicide/HasSuicidedFelix Lange2016-10-061-11/+11
| | | | The delete/remove naming has caused endless confusion in the past.
* core/state: implement reverts by journaling all changesFelix Lange2016-10-061-80/+130
| | | | | | | | | | 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/+10
|
* 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-281-40/+68
|
* core/state: track all accounts in canon stateFelix Lange2016-09-261-98/+131
| | | | | 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: Fix memory expansion bug by not copying clean objectsNick Johnson2016-09-191-2/+3
|
* 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
|/
* core/state, trie: don't leak database writes before commitPéter Szilágyi2016-01-201-3/+7
|
* 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-181-8/+14
|
* core/state, core, miner: handle missing root error from state.NewGustav Simonsson2015-10-161-5/+5
|
* cmd, core, eth: added official testnetJeffrey Wilcke2015-10-091-0/+5
|
* cmd/evm, core/vm, test: refactored VM and coreJeffrey Wilcke2015-10-041-14/+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-231-43/+43
|
* core, trie: new trieFelix Lange2015-09-231-8/+16
|
* all: move common.Database to package ethdbFelix Lange2015-09-151-2/+3
|
* core, core/vm, core/state: remove unused functionsGustav Simonsson2015-09-111-21/+0
|
* core, tests: Double SUICIDE fixJeffrey Wilcke2015-08-211-7/+9
|
* core/state: Set log index. Closes #1226Jeffrey Wilcke2015-07-291-0/+5
|
* 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: add some godoc synopsis commentsFelix Lange2015-07-071-0/+1
|
* all: update license informationFelix Lange2015-07-071-0/+16
|
* core, miner, tests: renamed state methodsJeffrey Wilcke2015-07-041-2/+4
| | | | | | | | | | | | * 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-041-2/+20
|
* core/state: removed trie copyobscuren2015-06-171-1/+1
|
* core/state: removed state from state objectobscuren2015-06-171-10/+2
|
* core/state, core/vm: reworked storage get / set to use common.Hashobscuren2015-06-171-5/+5
|
* core/state, core/vm: cleanup refundsobscuren2015-06-171-14/+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-081-9/+33
| | | | | | | 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.
* Moved logging to logger.Coreobscuren2015-04-041-1/+1
|
* basic glogobscuren2015-04-041-3/+1
|
* glog wipobscuren2015-04-031-1/+4
|
* Removed old (unused) argumentobscuren2015-04-021-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)
* moved state and vm to coreobscuren2015-03-231-0/+325