aboutsummaryrefslogtreecommitdiffstats
path: root/core/blockchain.go
Commit message (Collapse)AuthorAgeFilesLines
* core: fix finalize logic (#302)Jimmy Hu2019-06-131-4/+0
|
* core: touch verifierCache at 90% of round (#247)Jimmy Hu2019-06-121-2/+35
|
* app: new app test flow (#244)bojie2019-06-121-40/+0
|
* app: refactor app run as single chain (#226)bojie2019-06-121-146/+14
|
* core: sync to latest core (#214)Jimmy Hu2019-06-121-1/+1
| | | | | * vendor: sync to latest core * fix for single chain
* core, dex/downloader: polish headers verification and blocks insertion logic ↵Sonic2019-06-121-16/+28
| | | | | | | | (#168) Refactor GenerateDexonChain function, move governance tx logic to the user of GenerateDexonChain (testchain_test.go) and move fake node set code to FakeDexcon.
* travis: re-encrypt GCP credential file (#165)bojie2019-06-121-1/+1
|
* core, dex: use block hash as witness data (#160)Sonic2019-06-121-3/+3
| | | | | | | | | | Using only state root and receipt root as witness data can not protect other fields in block header, ex: bloom, difficulty, gas limit, gas used... So that everyone can manipulate these fields to create as many valid blocks at the same height as he want. Although this will not effect the state, one can spam us when syncing. Using block hash as witness data can solve this.
* blockchain: add mutex lock to prevent fork (#159)bojie2019-06-121-1/+6
|
* app: fix reward bug with empty block (#155)bojie2019-06-121-3/+2
| | | | | | | | * app: fix reward bug with empty block * make block generation consistent * revert change to dmoment in genesis.json
* app: remove pending block logic (#149)bojie2019-06-121-195/+136
|
* core: fix corner case when initializing round height (#134)Sonic2019-06-121-1/+1
|
* app: implement logic for prepare/verify correctly when chain number change ↵bojie2019-06-121-19/+97
| | | | (#118)
* core, indexer, dex: fix DexconApp block deliver after synced (#122)Sonic2019-06-121-5/+6
| | | | | | | When starts a bp node to sync with the network, bc.chainLastHeight map may not be initialized yet. Just return error if we can not get chain last height when preparing payload and verify block.
* core: fix vm wrong round height context (#124)Sonic2019-06-121-0/+45
| | | | Let roundHeightMap be corret whenever we starting a bp node.
* core, dex, internal: block proposer syncing (first iteration) (#96)Sonic2019-06-121-4/+2
| | | | | | | | | | | | | | | | | | | | | | * dex, internal: block proposer syncing (first iteration) * core: find block from db if not in memory This fix handles stopping proposing and then restarting * core: no need to reorg when reset Dexon will not fork. This commit also fix when a block confirm but its parent is not in db yet, during restarting proposing. * dex: always accept NewBlockMsg, NewBlockHashesMsg We need to accept NewBlockMsg, NewBlockHashesMsg to sync current block with other peers in block proposer mode when syncing lattice data. It's a waste when the node is synced and start proposing. Todo: control msg processing on/off more granular, accept NewBlockMsg, NewBlockHashesMsg when syncing, but stop when synced.
* core, dex: Timeout for prepare payload (#72)Jimmy Hu2019-06-121-7/+9
| | | | | | * Timeout on prepare payload * Leave 2 CPU for others * Add hardLimit and softLimit to PreparePayload
* app: add app test case and benchmark (#66)bojie2019-06-121-2/+14
|
* dex: verify header that imported from fetcher (#68)Sonic2019-06-121-0/+4
|
* core: panic if fork found when inserting header chain (#61)Wei-Ning Huang2019-06-121-1/+6
|
* core: commit states at snapshot height (#49)Sonic2019-06-121-2/+7
|
* core: various changes on tps tuning (#46)Wei-Ning Huang2019-06-121-0/+2
|
* core, dex, downloader: refactor governanceSonic2019-06-121-1/+1
|
* core, dex, dex/downloader: restore insertChain to upstream versionSonic2019-06-121-16/+14
| | | | | Also rename InsertChain2, insertChain2, InsertHeaderChain2, ValidateHeaderChain2
* core: implement insert chain, headerchain logicSonic2019-06-121-0/+226
|
* core: support extracting governance state from state trieSonic2019-06-121-0/+27
|
* core: add global signature cache and improve concurrency (#42)Wei-Ning Huang2019-06-121-1/+1
| | | | | From the go trace result, the bottleneck hides in the lock of StoreTxCache. To improve this, we update the cache in a batched fassion.
* governance: implement delegate/undelegate function and add tests (#33)Wei-Ning Huang2019-06-121-2/+5
| | | | | Implement delegate/undelegate function to allow others to delegate it's fund to stake on a node. Also added governance contract tests.
* core: blockchain: fix concurrent map read and write (#34)Wei-Ning Huang2019-06-121-4/+7
|
* core: more fix on light node synchronization (#32)Wei-Ning Huang2019-06-121-10/+11
| | | | | | Fix gas calculation in governance contract. Correctly register round height when processing pending blocks. We should register the mapping when we get the pending block instead of waiting for block confirmation.
* core: fix light node synchronization issue (#30)Wei-Ning Huang2019-06-121-0/+1
| | | | | InsertChain() need to record the correct roundHeight mapping in order to process snapshotRoundHeight() governance method correctly.
* core: revert changes to StateProcessor.Process (#29)Wei-Ning Huang2019-06-121-7/+9
|
* app: add cache to reuse same tx address which has already recovered (#26)BJ42019-06-121-2/+4
|
* core: refactor validator and fix light node sync (#25)Wei-Ning Huang2019-06-121-96/+25
| | | | | | | | Remove custom Dexon validator by adding a new `ValidateWitnessData` method into the validator interface. This allow us to properly detect know blocks. This also allow other gdex "light" client to sync compaction chain. Also, setup a standalone RPC node for handling RPC reqeusts.
* core: use storeRoundHeight to avoid type mismatch (#21)Sonic2019-06-121-9/+6
| | | No need to store round 0, it's already pushed in genesis block
* dex, core: Fix make fail (#24)Jimmy Hu2019-06-121-1/+1
|
* core, dex: Optimize sender calculation in block transactions. (#22)Jimmy Hu2019-06-121-0/+4
| | | | | | * Add Transactions.TouchSenders that calculates sender and update cache * Use TouchSenders to fill the caches
* core: validate DKG set with correct nodeset in round-2 (#19)Wei-Ning Huang2019-06-121-3/+7
| | | | | * vendor: sync consensus core * core: validate DKG set with correct nodeset in round-2
* dex: return correct pending nonce (#14)Wei-Ning Huang2019-06-121-2/+11
| | | | We need to return the correct pending nonce (include those in the tx pool). Also, StateAndHeaderByNumber is also fixed to use pending block.
* core: blockchain: fix NewBlockChainWithDexonValidator (#4)Wei-Ning Huang2019-06-121-1/+1
|
* app: fix core testBJ42019-06-121-1/+77
|
* core: vm: governance: add node infoWei-Ning Huang2019-06-121-0/+4
|
* core: validate roundHeight mapping in governance contractWei-Ning Huang2019-06-121-0/+12
|
* app: lock by chain correctly and remove old core in vendorBJ42019-06-121-46/+49
|
* Rename import due to dexon-consensus renameWei-Ning Huang2019-06-121-2/+2
|
* dex: minor refactorWei-Ning Huang2019-06-121-6/+5
|
* app: add lock to prevent concurrent map read writeBojie Wu2019-06-121-0/+3
|
* core: tx_pool: remove transactions on BlockConfirmed eventWei-Ning Huang2019-06-121-8/+18
|
* app: using lock correctly to use map safelyBojie Wu2019-06-121-56/+86
|
* app: fix concurrent map read write issue and accept fail transaction when ↵Bojie Wu2019-06-121-1/+7
| | | | round change
* app: add cache mechanism to increase performanceBojie Wu2019-06-121-101/+77
|
* app: fix concurrent read write issue with mapBojie Wu2019-06-121-0/+6
|
* dex: remove uneeded info from block headerWei-Ning Huang2019-06-121-9/+17
|
* app: correct process pending block logicBojie Wu2019-06-121-126/+111
|
* dex: fix missing randomness assignmentWei-Ning Huang2019-06-121-1/+1
|
* app: check nonce and balance in prepare payloadBojie Wu2019-06-121-3/+3
|
* app: implement verify block logicBojie Wu2019-06-121-1/+49
|
* app: fixup message formatWei-Ning Huang2019-06-121-3/+3
|
* app: implement new insert blocks logicBojie Wu2019-06-121-2/+193
|
* app: correct dexon application logicBojie Wu2019-06-121-44/+37
|
* core: fix nil map initializationWei-Ning Huang2019-06-121-0/+7
|
* app: init mapBojie Wu2019-06-121-15/+17
|
* app: implement new interface methodBojie Wu2019-06-121-0/+56
|
* Change import go github.com/dexon-foundation/dexonWei-Ning Huang2019-06-121-16/+16
|
* core: minor code polishes + rebase fixesPéter Szilágyi2019-04-081-37/+48
|
* core: re-omit new log event when logs rebirthrjl4934564422019-04-081-8/+19
|
* all: simplify timestamps to uint64 (#19372)Martin Holst Swende2019-04-081-6/+6
| | | | | | | | | | | | | | * 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
* core: fix pruner panic when importing low-diff-large-sidechainPéter Szilágyi2019-02-101-11/+17
|
* core: fix error in block iterator (#18986)Martin Holst Swende2019-02-101-3/+3
|
* core, eth: fix database version (#18429)gary rong2019-01-111-1/+1
| | | | | | * core, eth: fix database version * eth: polish error message
* core, internal, eth, miner, les: Take VM config from BlockChain (#17955)Paweł Bylica2018-12-061-0/+5
| | | | | | | | | | | Until this commit, when sending an RPC request that called `NewEVM`, a blank `vm.Config` would be taken so as to set some options, based on the default configuration. If some extra configuration switches were passed to the blockchain, those would be ignored. This PR adds a function to get the config from the blockchain, and this is what is now used for RPC calls. Some subsequent changes need to be made, see https://github.com/ethereum/go-ethereum/pull/17955#pullrequestreview-182237244 for the details of the discussion.
* core: more detailed metrics for block processing (#18119)Martin Holst Swende2018-11-281-1/+12
|
* core: return error if repair block failed (#18126)mr_franklin2018-11-231-1/+5
| | | | | | * core: return error if repair block failed * make error a bit shorter
* Merge pull request #17973 from holiman/splitter2Péter Szilágyi2018-11-221-153/+221
|\ | | | | core: better side-chain importing
| * core: polish side chain importer a bitPéter Szilágyi2018-11-211-290/+181
| |
| * core: better side-chain importingMartin Holst Swende2018-11-201-96/+273
| |
* | core: better printout of receipts in bad block reports (#18156)Martin Holst Swende2018-11-221-2/+4
|/ | | | | | * core/blockchain: better printout of receipts in bad block reports * fix splleing
* core, eth/downloader: fix ancestor lookup for fast syncPéter Szilágyi2018-11-161-2/+11
|
* cmd, core, eth, light, trie: add trie read caching layerPéter Szilágyi2018-11-151-7/+14
|
* core: fix default trie cache limit (#17860)gary rong2018-11-131-1/+1
|
* rawdb: remove unused parameter for WritePreimages func (#18059)Corey Lin2018-11-091-1/+1
| | | | | | | * rawdb: remove unused parameter for WritePreimages func and modify a spelling mistake * rawdb: update the doc for function WritePreimages
* core, internal/ethapi: add and use LRU cache for receipts (#17610)Ryan Schneider2018-09-301-6/+18
|
* core, eth: fix dependency cycle (#17720)gary rong2018-09-211-50/+21
|
* all: protect self-mined block during reorg (#17656)gary rong2018-09-201-4/+44
|
* common, core, light: add block age into info logsPéter Szilágyi2018-09-201-10/+18
|
* core, eth, trie: use common/prque (#17508)Wenbiao Zheng2018-09-031-3/+3
|
* miner: move agent logic to worker (#17351)gary rong2018-08-141-3/+4
| | | | | | | | * miner: move agent logic to worker * miner: polish * core: persist block before reorg
* core: fix some small typos on comment code (#17278)Ha ĐANG2018-07-301-1/+1
|
* core: report progress on log chain exports (#17066)Raghav Sood2018-07-261-3/+7
| | | | | | * core/blockchain: export progress * core: polish up chain export progress report a bit
* ethdb, core: implement delete for db batch (#17101)gary rong2018-07-021-3/+6
|
* trie: cache collapsed tries node, not rlp blobs (#16876)Péter Szilágyi2018-06-211-2/+2
| | | | | | | | | | | | 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, eth, les: more efficient hash-based header chain retrieval (#16946)Felföldi Zsolt2018-06-121-0/+12
|
* core: improve getBadBlocks to return full block rlp (#16902)Martin Holst Swende2018-06-111-13/+7
| | | | | | | | * core: improve getBadBlocks to return full block rlp * core, eth, ethapi: changes to getBadBlocks formatting * ethapi: address review concerns
* core: concurrent background transaction sender ecrecoverPéter Szilágyi2018-06-051-0/+7
|
* core, eth, trie: streaming GC for the trie cache (#16810)Péter Szilágyi2018-06-041-22/+20
| | | | | | * core, eth, trie: streaming GC for the trie cache * trie: track memcache statistics
* core/rawdb: separate raw database access to own package (#16666)Péter Szilágyi2018-05-071-70/+69
|
* core: check transaction/receipt count match when reconstructing blocks (#16272)Kyuntae Ethan Kim2018-03-071-2/+8
|
* core: make current*Block atomic, and accessor functions mutex-free (#16171)Martin Holst Swende2018-02-261-57/+55
| | | | | | | | | | * 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: flush out trie cache more meaningfully on stop (#16143)Péter Szilágyi2018-02-231-13/+12
| | | | | | * core: flush out trie cache more meaningfully on stop * core: upgrade legacy tests to chain maker
* metrics: pull library and introduce ResettingTimer and InfluxDB reporter ↵Anton Evangelatov2018-02-231-1/+1
| | | | | | | | | | | | | | | | | | | | (#15910) * go-metrics: fork library and introduce ResettingTimer and InfluxDB reporter. * vendor: change nonsense/go-metrics to ethersphere/go-metrics * go-metrics: add tests. move ResettingTimer logic from reporter to type. * all, metrics: pull in metrics package in go-ethereum * metrics/test: make sure metrics are enabled for tests * metrics: apply gosimple rules * metrics/exp, internal/debug: init expvar endpoint when starting pprof server * internal/debug: tiny comment formatting fix
* core: soften up state memory force-commit log messages (#16080)Felix Lange2018-02-131-6/+2
| | | | | | Talk about "state" instead of "trie timing", "trie memory" and remove the overzealous warning when the limit is just reached. Since the time limit is always reached on slow machines, move the message to info level so users don't freak out about internal details.
* core: force import known but rolled back blocksPéter Szilágyi2018-02-121-2/+6
|
* core, trie: intermediate mempool between trie and database (#15857)Péter Szilágyi2018-02-061-71/+263
| | | This commit reduces database I/O by not writing every state trie to disk.
* Merge pull request #15996 from karalabe/drop-redundant-methodsPéter Szilágyi2018-01-311-18/+1
|\ | | | | core, eth, les, light: get rid of redundant methods
| * core, eth, les, light: get rid of redundant methodsPéter Szilágyi2018-01-311-18/+1
| |
* | core, ethdb: reuse database batches (#15989)Martin Holst Swende2018-01-311-1/+1
|/ | | | | | * leveldb: Update leveldb to 211f780 (poolfix) * core, ethdb: reuse database batches
* core: sorted reorg insertion order for proper head header updatingPéter Szilágyi2018-01-221-7/+6
|
* all: switch gas limits from big.Int to uint64Péter Szilágyi2018-01-031-4/+4
|
* core, p2p/discv5: use time.NewTicker instead of time.Tick (#15747)ferhat elmas2018-01-021-2/+3
|
* core: split same-td blocks on block heightPéter Szilágyi2017-11-131-1/+6
|
* core: revert invalid block dedup code (#15235)Péter Szilágyi2017-10-041-5/+0
|
* core: only fire one chain head per batch (#15123)Péter Szilágyi2017-09-111-21/+32
| | | | | | * core: only fire one chain head per batch * miner: announce chan events synchronously
* core, eth/downloader: commit block data using batches (#15115)Felix Lange2017-09-101-127/+97
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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: add bloombit indexer, filter based on itZsolt Felfoldi2017-09-061-15/+0
|
* core: make txpool operate on immutable statePéter Szilágyi2017-09-051-12/+0
|
* core, light: send chain events using event.Feed (#14865)Miya Chen2017-08-181-23/+69
|
* core: avoid write existing block again (#14849)Mark2017-07-311-0/+5
|
* core: remove redundant storage of transactions and receipts (#14801)Péter Szilágyi2017-07-151-24/+9
| | | | | | | | | | | | | | * 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: fix an off-by-one when the block import counts blocksMartin Holst Swende2017-06-291-1/+1
|
* core/state: access trie through Database interface, track errors (#14589)Felix Lange2017-06-271-22/+16
| | | | | | | | | 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: fix minor accidental typos and comment errorsPéter Szilágyi2017-05-251-5/+5
|
* core: typos and comments improvechanghong2017-05-251-236/+237
| | | | | | | | 1. fix typos 2. methods recevier of struct should be same 3. comments improve (cherry picked from commit 1ba979539582a00b7fd1a7c8a37a6852e59eac0d)
* core: fix processing regression during receipt importPéter Szilágyi2017-05-081-3/+4
|
* core, light: delete SplitStatTy, ChainSplitEvent (unused)Felix Lange2017-04-221-6/+3
|
* 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
* core: fix comment typoJustin2017-04-101-1/+1
|
* consensus, core: drop all the legacy custom core error typesPéter Szilágyi2017-04-061-9/+8
|
* core, consensus: pluggable consensus engines (#3817)Péter Szilágyi2017-04-051-36/+26
| | | | | 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.
* les: implement request distributor, fix blocking issues (#3660)Felföldi Zsolt2017-03-231-1/+6
| | | | | * les: implement request distributor, fix blocking issues * core: moved header validation before chain mutex lock
* core, eth, les: support resuming fast sync on heavy rollback (#3743)Péter Szilágyi2017-03-221-24/+49
|
* all: swap out the C++ ethash to the pure Go one (mining todo)Péter Szilágyi2017-03-091-0/+3
|
* Merge pull request #3739 from karalabe/logger-updates-4Péter Szilágyi2017-03-041-2/+0
|\ | | | | all: update light logs (and a few others) to the new model
| * all: update light logs (and a few others) to the new modelPéter Szilágyi2017-03-031-2/+0
| |
* | core: reorg logs crashed, add a check for corner casesPéter Szilágyi2017-03-031-6/+9
|/
* core, log: track field length and pad to alignPéter Szilágyi2017-02-281-5/+5
|
* all: next batch of log polishes to contextual versionsPéter Szilágyi2017-02-281-83/+68
|
* all: blidly swap out glog to our log15, logs need reworkPéter Szilágyi2017-02-231-52/+52
|
* core, core/state, core/vm: remove exported account getters (#3618)Jeffrey Wilcke2017-02-231-1/+0
| | | | Removed exported statedb object accessors, reducing the chance for nasty bugs to creep in. It's also ugly and unnecessary to have these methods.
* core/blockchain: Change iterator in procFutureBlocks to use lru.Peek instead ↵Martin Holst Swende2017-02-181-1/+1
| | | | of Get (#3655)
* core, eth, internal: Added `debug_getBadBlocks()` method (#3654)Martin Holst Swende2017-02-141-1/+29
| | | | | | | | | | | | | | | | * core,eth,internal: Added `debug_getBadBlocks()` method When bad blocks are discovered, these are stored within geth. An RPC-endpoint makes them availablewithin the `debug` namespace. This feature makes it easier to discover network forks. ``` * core, api: go format + docs * core/blockchain: Documentation, fix minor nitpick * core: fix failing blockchain test
* core: fix a small typo in blockchain.go (#3611)Vivek Anand2017-01-261-1/+1
|
* core/blockchain: Made logging of reorgs more structured (#3573)Martin Holst Swende2017-01-171-6/+13
| | | | | | | | * core: Made logging of reorgs more structured, also always log if reorg is > 63 blocks long * core/blockchain: go fmt * core/blockchain: Minor fixes to the reorg reporting
* cmd/geth, core: add support for recording SHA3 preimages (#3543)Nick Johnson2017-01-171-2/+8
|
* core: improve import log alignmentFelix Lange2017-01-111-9/+7
|
* all: fix ineffectual assignments and remove uses of crypto.Sha3Felix Lange2017-01-091-2/+1
| | | | | go get github.com/gordonklaus/ineffassign ineffassign .
* logger, pow/dagger, pow/ezp: delete dead codeFelix Lange2017-01-071-3/+0
|
* all: fix issues reported by honnef.co/go/simple/cmd/gosimpleFelix Lange2017-01-071-4/+1
|
* all: gofmt -w -sFelix Lange2017-01-061-1/+1
|
* core/vm: move Log to core/typesFelix Lange2017-01-061-3/+3
| | | | | | | | 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: import future blocks one-by-one, enfore chain ancestryPéter Szilágyi2016-12-131-3/+29
|
* core, core/vm, eth/filters: move Removed field into vm.LogFelix Lange2016-12-051-14/+15
| | | | | | | | | | | | This field used to be assigned by the filter system and returned through the RPC API. Now that we have a Go client that uses the underlying type, the field needs to move. It is now assigned to true when the RemovedLogs event is generated so the filter system doesn't need to care about the field at all. While here, remove the log list from ChainSideEvent. There are no users of this field right now and any potential users could subscribe to RemovedLogsEvent instead.
* core: fixed unwinding bad hash (#3347)Jeffrey Wilcke2016-11-281-3/+8
| | | Fixed unwinding of bad hashes when already on the canon chain
* core: improved bad block error reporting (#3320)Jeffrey Wilcke2016-11-231-8/+21
|
* core/types, params: EIP#155Jeffrey Wilcke2016-11-131-5/+8
|
* 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.