aboutsummaryrefslogtreecommitdiffstats
path: root/core/database_util.go
Commit message (Collapse)AuthorAgeFilesLines
* les, light: LES/2 protocol version (#14970)Felföldi Zsolt2017-10-241-8/+7
| | | | | | | | | | | | | | | | | | This PR implements the new LES protocol version extensions: * new and more efficient Merkle proofs reply format (when replying to a multiple Merkle proofs request, we just send a single set of trie nodes containing all necessary nodes) * BBT (BloomBitsTrie) works similarly to the existing CHT and contains the bloombits search data to speed up log searches * GetTxStatusMsg returns the inclusion position or the pending/queued/unknown state of a transaction referenced by hash * an optional signature of new block data (number/hash/td) can be included in AnnounceMsg to provide an option for "very light clients" (mobile/embedded devices) to skip expensive Ethash check and accept multiple signatures of somewhat trusted servers (still a lot better than trusting a single server completely and retrieving everything through RPC). The new client mode is not implemented in this PR, just the protocol extension.
* core, eth/downloader: commit block data using batches (#15115)Felix Lange2017-09-101-28/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * ethdb: add Putter interface and Has method * ethdb: improve docs and add IdealBatchSize * ethdb: remove memory batch lock Batches are not safe for concurrent use. * core: use ethdb.Putter for Write* functions This covers the easy cases. * core/state: simplify StateSync * trie: optimize local node check * ethdb: add ValueSize to Batch * core: optimize HasHeader check This avoids one random database read get the block number. For many uses of HasHeader, the expectation is that it's actually there. Using Has avoids a load + decode of the value. * core: write fast sync block data in batches Collect writes into batches up to the ideal size instead of issuing many small, concurrent writes. * eth/downloader: commit larger state batches Collect nodes into a batch up to the ideal size instead of committing whenever a node is received. * core: optimize HasBlock check This avoids a random database read to get the number. * core: use numberCache in HasHeader numberCache has higher capacity, increasing the odds of finding the header without a database lookup. * core: write imported block data using a batch Restore batch writes of state and add blocks, tx entries, receipts to the same batch. The change also simplifies the miner. This commit also removes posting of logs when a forked block is imported. * core: fix DB write error handling * ethdb: use RLock for Has * core: fix HasBlock comment
* core, eth: clean up bloom filtering, add some testsPéter Szilágyi2017-09-061-67/+91
|
* core, eth: add bloombit indexer, filter based on itZsolt Felfoldi2017-09-061-48/+21
|
* core: remove redundant storage of transactions and receipts (#14801)Péter Szilágyi2017-07-151-116/+78
| | | | | | | | | | | | | | * core: remove redundant storage of transactions and receipts * core, eth, internal: new transaction schema usage polishes * eth: implement upgrade mechanism for db deduplication * core, eth: drop old sequential key db upgrader * eth: close last iterator on successful db upgrage * core: prefix the lookup entries to make their purpose clearer
* core: typos and comments improvechanghong2017-05-251-3/+3
| | | | | | | | 1. fix typos 2. methods recevier of struct should be same 3. comments improve (cherry picked from commit 1ba979539582a00b7fd1a7c8a37a6852e59eac0d)
* all: next batch of log polishes to contextual versionsPéter Szilágyi2017-02-281-26/+21
|
* core, eth: drop database block splitting upgraderPéter Szilágyi2017-02-281-18/+0
|
* all: blidly swap out glog to our log15, logs need reworkPéter Szilágyi2017-02-231-25/+24
|
* 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-6/+39
|
* core: fix race condition in WriteMipmapBloomBas van Kervel2017-01-091-0/+6
|
* core, core/state, trie: EIP158, reprice & skip empty account writeJeffrey Wilcke2016-11-131-3/+7
| | | | | | | | | | | | | | | 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/types: remove header accessorsFelix Lange2016-11-091-6/+6
| | | | | | These accessors were introduced by light client changes, but the only method that is actually used is GetNumberU64. This commit replaces all uses of .GetNumberU64 with .Number.Uint64.
* light: light chain, VM env and tx poolZsolt Felfoldi2016-11-091-1/+43
|
* core: ensure the canonical block is written before the canonical hash is setBas van Kervel2016-08-161-1/+5
|
* core: improved chainDb using sequential keyszsfelfoldi2016-06-071-65/+114
|
* core, core/types, eth: add and use Block.BodyFelix Lange2016-04-151-1/+1
| | | | | This fixes a few uses of unkeyed Body literals which go vet was complaining about.
* core: added basic chain configurationJeffrey Wilcke2016-04-011-0/+34
| | | | | | | | | 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, core/vm, crypto: fixes for homesteadJeffrey Wilcke2016-02-181-14/+0
| | | | | | * 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-69/+14
| | | | | | | | * 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
* common: remove old RLP implementation, Value and ExtPackageFelix Lange2015-12-181-0/+14
| | | | | In order to make this happen, kill all remaining trivial uses of common/{rlp,value}.go. The non-trivial ones have been updated earlier.
* core, eth, miner, xeth: clean up tx/receipt db accessorsPéter Szilágyi2015-11-191-0/+584