aboutsummaryrefslogtreecommitdiffstats
path: root/core/headerchain.go
Commit message (Collapse)AuthorAgeFilesLines
* core: vm: refactor file structurejm2019-05-061-3/+3
| | | | | For support other vm types, this pr modified the core/vm file structures.
* core, rawdb, dex: improve gov state for syncing (#393)Sonic2019-04-241-0/+1
| | | | * core, rawdb, dex: improve gov state for syncing
* core: optimize verify header (#381)Jimmy Hu2019-04-221-11/+76
|
* core: only verify the last tsig of header chain (#380)Jimmy Hu2019-04-201-6/+13
|
* fixup! Change import go github.com/dexon-foundation/dexonJhih-Ming Huang2019-04-101-1/+1
|
* vendor: sync to latest core (#320)Jimmy Hu2019-04-091-4/+4
| | | | | | | | * vendor: sync to latest core * dex, core: fix conflict x
* core: check coinbase for empty block (#282)Jimmy Hu2019-04-091-6/+13
|
* core: fix headerchain coinbase validationWei-Ning Huang2019-04-091-2/+7
| | | | Coinbase address is the owner address of the node.
* core: vm: flatten governanceWei-Ning Huang2019-04-091-1/+1
|
* core, dex/downloader: polish headers verification and blocks insertion logic ↵Sonic2019-04-091-12/+132
| | | | | | | | (#168) Refactor GenerateDexonChain function, move governance tx logic to the user of GenerateDexonChain (testchain_test.go) and move fake node set code to FakeDexcon.
* core, dex, dex/downloader: restore insertChain to upstream versionSonic2019-04-091-4/+4
| | | | | Also rename InsertChain2, insertChain2, InsertHeaderChain2, ValidateHeaderChain2
* core: implement insert chain, headerchain logicSonic2019-04-091-0/+193
|
* Change import go github.com/dexon-foundation/dexonWei-Ning Huang2019-04-091-7/+7
|
* all: simplify timestamps to uint64 (#19372)Martin Holst Swende2019-04-081-1/+1
| | | | | | | | | | | | | | * all: simplify timestamps to uint64 * tests: update definitions * clef, faucet, mobile: leftover uint64 fixups * ethash: fix tests * graphql: update schema for timestamp * ethash: remove unused variable
* common, core, light: add block age into info logsPéter Szilágyi2018-09-201-2/+12
|
* core: fix some small typos on comment code (#17278)Ha ĐANG2018-07-301-1/+1
|
* ethdb, core: implement delete for db batch (#17101)gary rong2018-07-021-7/+12
|
* core, eth, les: more efficient hash-based header chain retrieval (#16946)Felföldi Zsolt2018-06-121-0/+37
|
* core/rawdb: separate raw database access to own package (#16666)Péter Szilágyi2018-05-071-38/+39
|
* core: minor evm polishes and optimizationsPéter Szilágyi2018-03-261-1/+1
|
* core: make current*Block atomic, and accessor functions mutex-free (#16171)Martin Holst Swende2018-02-261-18/+21
| | | | | | | | | | * core: make current*Block atomic, and accessor functions mutex-free * core: fix review concerns * core: fix error in atomic assignment * core/light: implement atomic getter/setter for headerchain
* core, eth/downloader: commit block data using batches (#15115)Felix Lange2017-09-101-5/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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: typos and comments improvechanghong2017-05-251-9/+8
| | | | | | | | 1. fix typos 2. methods recevier of struct should be same 3. comments improve (cherry picked from commit 1ba979539582a00b7fd1a7c8a37a6852e59eac0d)
* consensus, core, ethstats: use engine specific block beneficiary (#14318)Péter Szilágyi2017-04-121-0/+3
| | | | | | * consensus, core, ethstats: use engine specific block beneficiary * core, eth, les, miner: use explicit beneficiary during mining
* consensus, core: drop all the legacy custom core error typesPéter Szilágyi2017-04-061-2/+2
|
* core, consensus: pluggable consensus engines (#3817)Péter Szilágyi2017-04-051-112/+37
| | | | | This commit adds pluggable consensus engines to go-ethereum. In short, it introduces a generic consensus interface, and refactors the entire codebase to use this interface.
* core: refactor genesis handlingFelix Lange2017-03-231-6/+1
| | | | | | | | | | | | | | | | | | | | | | | | This commit solves several issues concerning the genesis block: * Genesis/ChainConfig loading was handled by cmd/geth code. This left library users in the cold. They could specify a JSON-encoded string and overwrite the config, but didn't get any of the additional checks performed by geth. * Decoding and writing of genesis JSON was conflated in WriteGenesisBlock. This made it a lot harder to embed the genesis block into the forthcoming config file loader. This commit changes things so there is a single Genesis type that represents genesis blocks. All uses of Write*Genesis* are changed to use the new type instead. * If the chain config supplied by the user was incompatible with the current chain (i.e. the chain had already advanced beyond a scheduled fork), it got overwritten. This is not an issue in practice because previous forks have always had the highest total difficulty. It might matter in the future though. The new code reverts the local chain to the point of the fork when upgrading configuration. The change to genesis block data removes compression library dependencies from package core.
* les: implement request distributor, fix blocking issues (#3660)Felföldi Zsolt2017-03-231-4/+9
| | | | | * les: implement request distributor, fix blocking issues * core: moved header validation before chain mutex lock
* Merge pull request #3723 from karalabe/logger-updates-2Péter Szilágyi2017-02-281-22/+15
|\ | | | | Logger updates
| * core, log: track field length and pad to alignPéter Szilágyi2017-02-281-2/+2
| |
| * all: next batch of log polishes to contextual versionsPéter Szilágyi2017-02-281-22/+15
| |
* | all: unify big.Int zero checks, use common/math in more places (#3716)Felix Lange2017-02-281-1/+1
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | * common/math: optimize PaddedBigBytes, use it more name old time/op new time/op delta PaddedBigBytes-8 71.1ns ± 5% 46.1ns ± 1% -35.15% (p=0.000 n=20+19) name old alloc/op new alloc/op delta PaddedBigBytes-8 48.0B ± 0% 32.0B ± 0% -33.33% (p=0.000 n=20+20) * all: unify big.Int zero checks Various checks were in use. This commit replaces them all with Int.Sign, which is cheaper and less code. eg templates: func before(x *big.Int) bool { return x.BitLen() == 0 } func after(x *big.Int) bool { return x.Sign() == 0 } func before(x *big.Int) bool { return x.BitLen() > 0 } func after(x *big.Int) bool { return x.Sign() != 0 } func before(x *big.Int) int { return x.Cmp(common.Big0) } func after(x *big.Int) int { return x.Sign() } * common/math, crypto/secp256k1: make ReadBits public in package math
* all: blidly swap out glog to our log15, logs need reworkPéter Szilágyi2017-02-231-12/+11
|
* core: improve import log alignmentFelix Lange2017-01-111-1/+1
|
* core: import future blocks one-by-one, enfore chain ancestryPéter Szilágyi2016-12-131-0/+11
|
* core, core/state, trie: EIP158, reprice & skip empty account writeJeffrey Wilcke2016-11-131-4/+5
| | | | | | | | | | | | | | | 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>
* common, core, eth/downloader: adjust import log formattingPéter Szilágyi2016-10-181-2/+7
|
* core: ensure the canonical block is written before the canonical hash is setBas van Kervel2016-08-161-7/+11
|
* core: improved chainDb using sequential keyszsfelfoldi2016-06-071-28/+69
|
* all: update license informationFelix Lange2016-04-151-0/+1
|
* core: added basic chain configurationJeffrey Wilcke2016-04-011-7/+12
| | | | | | | | | 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: cache fresh headers and tds to avoid db trashingPéter Szilágyi2016-03-111-18/+50
|
* core: create a header chain structure shared by core.BlockChain and ↵zsfelfoldi2016-03-101-0/+432
light.LightChain