aboutsummaryrefslogtreecommitdiffstats
path: root/core/blockchain.go
Commit message (Collapse)AuthorAgeFilesLines
* core, core/state, trie: EIP158, reprice & skip empty account writeJeffrey Wilcke2016-11-131-5/+6
| | | | | | | | | | | | | | | 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>
* light: light chain, VM env and tx poolZsolt Felfoldi2016-11-091-26/+32
|
* cmd/geth, code, eth/downloader: tune import logs and mem statsPéter Szilágyi2016-10-211-2/+15
|
* Merge pull request #3156 from holiman/metrics-blocksJeffrey Wilcke2016-10-181-0/+2
|\ | | | | core: Add block processing time metric collection
| * core: Add block processing time metric collectionMartin Holst Swende2016-10-181-0/+2
| |
* | common, core, eth/downloader: adjust import log formattingPéter Szilágyi2016-10-181-16/+23
|/
* trie, core/state: improve memory usage and performance (#3135)Felix Lange2016-10-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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: fixed import reporterJeffrey Wilcke2016-10-111-1/+1
|
* core: print import stats more oftenFelix Lange2016-10-081-11/+42
| | | | | | If geth is busy importing 2048 heavy blocks it can take a while before it prints anything. This change ensures that a message gets printed every 8s.
* core, eth, trie: reuse trie journals in all our codePéter Szilágyi2016-09-281-1/+6
|
* core/state: track all accounts in canon stateFelix Lange2016-09-261-13/+22
| | | | | This change introduces a global, per-state cache that keeps account data in the canon state. Thanks to @karalabe for lots of fixes.
* core: ensure the canonical block is written before the canonical hash is setBas van Kervel2016-08-161-9/+9
|
* core: solve a remote-import/local-mine data racePéter Szilágyi2016-07-081-4/+3
|
* core: improved chainDb using sequential keyszsfelfoldi2016-06-071-52/+72
|
* core, core/state, trie: enterprise hand-tuned multi-level cachingPéter Szilágyi2016-05-261-1/+6
|
* eth: enable bad block reportsFelix Lange2016-05-251-4/+1
| | | | | | | | | | | | We used to have reporting of bad blocks, but it was disabled before the Frontier release. We need it back because users are usually unable to provide the full RLP data of a bad block when it occurs. A shortcoming of this particular implementation is that the origin peer is not tracked for blocks received during eth/63 sync. No origin peer info is still better than no report at all though.
* core: Provide a public accessor for ChainConfigNicholas Johnson2016-04-291-0/+3
| | | | This is necessary for external users of the go-ethereum code who want to, for instance, build a custom node that plays back transactions, as core.ApplyTransaction requires a ChainConfig as a parameter.
* all: fix go vet warningsFelix Lange2016-04-151-2/+2
|
* 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-15/+10
| | | | | | | | | 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, eth, cmd: temporary work around for enabling the jitJeffrey Wilcke2016-03-241-1/+6
| | | | | This commit serves as a temporary workaround for enabling the jit until the block customisation PR is merged in.
* core: Added EVM configuration optionsJeffrey Wilcke2016-03-241-1/+1
| | | | | The EVM is now initialised with an additional configured object that allows you to turn on debugging options.
* Merge pull request #2341 from leijurv/patch-2Péter Szilágyi2016-03-161-3/+3
|\ | | | | core: fixed various typos
| * core: fixed various typosLeif Jurvetson2016-03-161-3/+3
| |
* | core, eth: replace reorganiz with reorganisLeif Jurvetson2016-03-161-1/+1
|/
* Merge pull request #2311 from obscuren/future-proc-fixJeffrey Wilcke2016-03-121-14/+15
|\ | | | | core: added future proc mutex lock
| * core: added future proc mutex lockJeffrey Wilcke2016-03-111-14/+15
| | | | | | | | | | | | | | | | | | | | Added a future lock which prevents the anything being added or removed from or to the set when looping over the set of blocks. This fixes a nil pointer in the range loop when trying to retrieve a block from the set which was previously available but removed due to regular chain processing. Fixes #2305
* | core: cache fresh headers and tds to avoid db trashingPéter Szilágyi2016-03-111-2/+2
|/
* core: create a header chain structure shared by core.BlockChain and ↵zsfelfoldi2016-03-101-340/+125
| | | | light.LightChain
* core: announce ChainSideEvent during reorgJeffrey Wilcke2016-03-081-6/+21
| | | | | | | | | | | Previously all blocks that were already in our chain were never re announced as potential uncle block (e.g. ChainSideEvent). This is problematic during mining where you want to gather as much possible uncles as possible increasing the profit. This is now addressed in this PR where during reorganisations of chains the old chain is regarded as uncles. Fixed #2298
* core: Added new TD strategy which mitigate the risk for selfish miningJeffrey Wilcke2016-02-181-6/+14
| | | | | | | | | | | | | | | | Assuming the following scenario where a miner has 15% of all hashing power and the ability to exert a moderate control over the network to the point where if the attacker sees a message A, it can't stop A from propagating, but what it **can** do is send a message B and ensure that most nodes see B before A. The attacker can then selfish mine and augment selfish mining strategy by giving his own blocks an advantage. This change makes the time at which a block is received less relevant and so the level of control an attacker has over the network no longer makes a difference. This change changes the current td algorithm `B_td > C_td` to the new algorithm `B_td > C_td || B_td == C_td && rnd < 0.5`.
* eth/filters: ✨ pending logs ✨Jeffrey Wilcke2016-02-131-1/+1
| | | | | | Pending logs are now filterable through the Go API. Filter API changed such that each filter type has it's own bucket and adding filter explicitly requires you specify the bucket to put it in.
* core, eth/downloader: ensure state presence in ancestor lookupPéter Szilágyi2016-01-041-0/+13
|
* core: write individual transactions and receipts too on fast syncPéter Szilágyi2015-12-041-0/+12
|
* core: added a new RemovedLogEventJeffrey Wilcke2015-12-011-2/+20
| | | | | | When a chain reorganisation occurs we collect the logs that were deleted during the chain reorganisation. The removed logs are posted to the event mux indicating that those were deleted during the reorg.
* cmd, common, core, eth, node, rpc, tests, whisper, xeth: use protocol stacksPéter Szilágyi2015-11-271-5/+1
|
* core, eth, miner, xeth: clean up tx/receipt db accessorsPéter Szilágyi2015-11-191-6/+6
|
* core, eth, rpc: split out block validator and state processorJeffrey Wilcke2015-11-181-20/+114
| | | | | | | | | | | | This removes the burden on a single object to take care of all validation and state processing. Now instead the validation is done by the `core.BlockValidator` (`types.Validator`) that takes care of both header and uncle validation through the `ValidateBlock` method and state validation through the `ValidateState` method. The state processing is done by a new object `core.StateProcessor` (`types.Processor`) and accepts a new state as input and uses that to process the given block's transactions (and uncles for rewords) to calculate the state root for the next block (P_n + 1).
* core: only reset head header/fastblock if stalePéter Szilágyi2015-10-281-11/+18
|
* core, eth, trie: fix data races and merge/review issuesPéter Szilágyi2015-10-211-29/+42
|
* core, eth: roll back uncertain headers in failed fast syncsPéter Szilágyi2015-10-191-1/+36
|
* eth/downloader: concurrent receipt and state processingPéter Szilágyi2015-10-191-86/+180
|
* core, eth, trie: direct state trie synchronizationPéter Szilágyi2015-10-191-4/+21
|
* core, eth: receipt chain reconstructionPéter Szilágyi2015-10-191-40/+170
|
* core: fix block canonical mark / content write racePéter Szilágyi2015-10-191-20/+11
|
* core: support inserting pure header chainsPéter Szilágyi2015-10-191-65/+233
|
* Merge pull request #1899 from obscuren/mipmap-bloomJeffrey Wilcke2015-10-171-5/+22
|\ | | | | core, eth/filters, miner, xeth: Optimised log filtering
| * core, eth/filters, miner, xeth: Optimised log filteringJeffrey Wilcke2015-10-171-5/+22
| | | | | | | | | | | | | | Log filtering is now using a MIPmap like approach where addresses of logs are added to a mapped bloom bin. The current levels for the MIP are in ranges of 1.000.000, 500.000, 100.000, 50.000, 1.000. Logs are therefor filtered in batches of 1.000.
* | core/state, core, miner: handle missing root error from state.NewGustav Simonsson2015-10-161-1/+1
|/
* core, eth, event, miner, xeth: fix event post / subscription racePéter Szilágyi2015-10-121-38/+27
|
* core: fixed head write on block insertionJeffrey Wilcke2015-10-051-0/+3
| | | | | Due to a rebase this probably got overlooked / ignored. This fixes the issue of a block insertion never writing the last block.
* cmd/geth, cmd/utils, core, rpc: renamed to blockchainJeffrey Wilcke2015-10-041-0/+809
* Renamed ChainManager to BlockChain * Checkpointing is no longer required and never really properly worked when the state was corrupted.