aboutsummaryrefslogtreecommitdiffstats
path: root/blockpool/peers_test.go
Commit message (Collapse)AuthorAgeFilesLines
* blockpool: deletedobscuren2015-04-211-211/+0
|
* blockpool stability fixes:zelig2015-04-131-42/+71
| | | | | | | | | | | | - follow up locks and fix them - chainManager: call SetQueued for parentErr future blocks, uncomment TD checks, unskip test - make ErrIncorrectTD non-fatal to be forgiving to genuine mistaken nodes (temp) but demote them to guard against stuck best peers. - add purging to bounded nodeCache (config nodeCacheSize) - use nodeCache when creating blockpool entries and let non-best peers add blocks (performance boost) - minor error in addError - reduce idleBestPeerTimeout to 1 minute - correct status counts and unskip status passing status test - glogified logging
* td update from nodezelig2015-04-101-7/+4
| | | | | | | - reorg and simplify AddBlock - introduce nodeCache - TestPeerPromotionByTdOnBlock unskipped and passes - move switchC/idleC channel creation around: solves deadlock (now respects the contract with section process: either can activate or complete at any one time)
* introduce peers registry on nodeszelig2015-04-091-8/+4
| | | | | | | | | | | | - TestPeerPromotionByTdOnBlock renamed and skipped for now test should pass iff if TD is updated based on an agreement - senders register in AddBlock, flag records if they are coming from newblock message (and therefore advertise their TD with the block) or block message (TODO: latter are stored on the cache and updated by checkTD call; protocol should also call AddBlock on newblock messages by non-best peers) - remove TD update from optional TD field in addBlock: this is no longer part of the eth protocol spec -> TODO: reflect in wiki - only initialise peer map if at least two
* header check for testzelig2015-03-251-2/+3
|
* fix common.Hash conversionzelig2015-03-201-2/+2
|
* improve documentation and move one testzelig2015-03-201-0/+44
|
* check and penalise td misreportingzelig2015-03-201-9/+9
| | | | | | - add ErrIncorrectTD - checkTD called after insertChain successful - fix tests, use blockPoolTester.tds to map block index to TD
* use own total difficulty to limit best peerzelig2015-03-201-1/+25
| | | | | | | | | - update blockpool td by subscribing to ChainHeadEvent - if ahead of best peer, demote it - addPeer now take own td as current td - removePeer now take own td as current td - add relevant tests to peers_test - eth: backend now calls blockpool with eth.eventMux and chainManager.Td
* major rewrite, reorg of blockpool + new featureszelig2015-02-251-0/+120
- blockpool moves to its own package - uses errs pkg for its own coded errors - publicly settable config of params (time intervals and batchsizes) - test helpers in subpackage - optional TD in blocks used now to update peers chain info - major improvement in algorithm - fix fragility and sync/parallelisation bugs - implement status for reporting on sync status (peers/hashes/blocks etc) - several tests added and further corner cases covered