aboutsummaryrefslogtreecommitdiffstats
path: root/eth/sync.go
Commit message (Collapse)AuthorAgeFilesLines
* all: new p2p node representation (#17643)Felix Lange2018-09-251-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Package p2p/enode provides a generalized representation of p2p nodes which can contain arbitrary information in key/value pairs. It is also the new home for the node database. The "v4" identity scheme is also moved here from p2p/enr to remove the dependency on Ethereum crypto from that package. Record signature handling is changed significantly. The identity scheme registry is removed and acceptable schemes must be passed to any method that needs identity. This means records must now be validated explicitly after decoding. The enode API is designed to make signature handling easy and safe: most APIs around the codebase work with enode.Node, which is a wrapper around a valid record. Going from enr.Record to enode.Node requires a valid signature. * p2p/discover: port to p2p/enode This ports the discovery code to the new node representation in p2p/enode. The wire protocol is unchanged, this can be considered a refactoring change. The Kademlia table can now deal with nodes using an arbitrary identity scheme. This requires a few incompatible API changes: - Table.Lookup is not available anymore. It used to take a public key as argument because v4 protocol requires one. Its replacement is LookupRandom. - Table.Resolve takes *enode.Node instead of NodeID. This is also for v4 protocol compatibility because nodes cannot be looked up by ID alone. - Types Node and NodeID are gone. Further commits in the series will be fixes all over the the codebase to deal with those removals. * p2p: port to p2p/enode and discovery changes This adapts package p2p to the changes in p2p/discover. All uses of discover.Node and discover.NodeID are replaced by their equivalents from p2p/enode. New API is added to retrieve the enode.Node instance of a peer. The behavior of Server.Self with discovery disabled is improved. It now tries much harder to report a working IP address, falling back to 127.0.0.1 if no suitable address can be determined through other means. These changes were needed for tests of other packages later in the series. * p2p/simulations, p2p/testing: port to p2p/enode No surprises here, mostly replacements of discover.Node, discover.NodeID with their new equivalents. The 'interesting' API changes are: - testing.ProtocolSession tracks complete nodes, not just their IDs. - adapters.NodeConfig has a new method to create a complete node. These changes were needed to make swarm tests work. Note that the NodeID change makes the code incompatible with old simulation snapshots. * whisper/whisperv5, whisper/whisperv6: port to p2p/enode This port was easy because whisper uses []byte for node IDs and URL strings in the API. * eth: port to p2p/enode Again, easy to port because eth uses strings for node IDs and doesn't care about node information in any way. * les: port to p2p/enode Apart from replacing discover.NodeID with enode.ID, most changes are in the server pool code. It now deals with complete nodes instead of (Pubkey, IP, Port) triples. The database format is unchanged for now, but we should probably change it to use the node database later. * node: port to p2p/enode This change simply replaces discover.Node and discover.NodeID with their new equivalents. * swarm/network: port to p2p/enode Swarm has its own node address representation, BzzAddr, containing both an overlay address (the hash of a secp256k1 public key) and an underlay address (enode:// URL). There are no changes to the BzzAddr format in this commit, but certain operations such as creating a BzzAddr from a node ID are now impossible because node IDs aren't public keys anymore. Most swarm-related changes in the series remove uses of NewAddrFromNodeID, replacing it with NewAddr which takes a complete node as argument. ToOverlayAddr is removed because we can just use the node ID directly.
* eth: update higest block we know during the sync if a higher was found (#16283)gary rong2018-03-091-0/+8
| | | | | | * eth: update higest block we know during the sync if a higher was found * eth: avoid useless sync in fast sync
* eth: only disable fast sync after successPéter Szilágyi2018-02-111-10/+5
|
* eth: disable fast sync after pivot is committedPéter Szilágyi2017-09-061-9/+11
|
* eth: fix megacheck warningsEgon Elbre2017-08-081-2/+4
|
* eth: don't import propagated blocks during fastsyncPéter Szilágyi2017-05-261-0/+1
|
* eth: accept transactions when starting CPU mining (#13882)Péter Szilágyi2017-04-101-1/+1
|
* eth: announce block after sync cycle (star topology)Péter Szilágyi2017-04-101-1/+9
|
* core, eth, les: support resuming fast sync on heavy rollback (#3743)Péter Szilágyi2017-03-221-0/+8
|
* Logger updates 3 (#3730)Péter Szilágyi2017-03-021-4/+3
| | | | | | | | * accounts, cmd, eth, ethdb: port logs over to new system * ethdb: drop concept of cache distribution between dbs * eth: fix some log nitpicks to make them nicer
* all: blidly swap out glog to our log15, logs need reworkPéter Szilágyi2017-02-231-5/+5
|
* les: remove delayed les server startingZsolt Felfoldi2017-01-261-8/+1
|
* Merge pull request #3413 from zsfelfoldi/light-topic4Felix Lange2016-12-131-1/+8
|\ | | | | les, p2p/discv5: implement server pool, improve peer selection, light fetcher and topic searching
| * eth, les: defer starting LES service until ETH initial sync is finishedZsolt Felfoldi2016-12-101-1/+8
| |
* | core: bugfix state change race condition in txpool (#3412)bas-vk2016-12-111-1/+2
|/ | | | | | | | The transaction pool keeps track of the current nonce in its local pendingState. When a new block comes in the pendingState is reset. During the reset it fetches multiple times the current state through the use of the currentState callback. When a second block comes in during the reset its possible that the state changes during the reset. If that block holds transactions that are currently in the pool the local pendingState that is used to determine nonces can get out of sync.
* core, eth, internal, miner: optimize txpool for quick opsPéter Szilágyi2016-09-021-1/+4
|
* eth, eth/downloader: better remote head trackingPéter Szilágyi2016-07-251-3/+5
|
* core: improved chainDb using sequential keyszsfelfoldi2016-06-071-1/+2
|
* eth: don't accept transactions until we sync up with the networkPéter Szilágyi2016-06-061-0/+2
|
* eth: skip transaction handling during fast syncPéter Szilágyi2016-05-171-3/+4
|
* core, eth, miner: improve shutdown synchronisationFelix Lange2016-05-091-1/+1
| | | | | | | | | | | | | | | | | | | | Shutting down geth prints hundreds of annoying error messages in some cases. The errors appear because the Stop method of eth.ProtocolManager, miner.Miner and core.TxPool is asynchronous. Left over peer sessions generate events which are processed after Stop even though the database has already been closed. The fix is to make Stop synchronous using sync.WaitGroup. For eth.ProtocolManager, in order to make use of WaitGroup safe, we need a way to stop new peer sessions from being added while waiting on the WaitGroup. The eth protocol Run function now selects on a signaling channel and adds to the WaitGroup only if ProtocolManager is not shutting down. For miner.worker and core.TxPool the number of goroutines is static, WaitGroup can be used in the usual way without additional synchronisation.
* eth: remove workaround for asynchronous processing in the downloaderFelix Lange2015-11-191-4/+0
|
* eth: don't block sync goroutines that short circuitPéter Szilágyi2015-10-281-2/+5
|
* core, eth, trie: fix data races and merge/review issuesPéter Szilágyi2015-10-211-1/+17
|
* core: support inserting pure header chainsPéter Szilágyi2015-10-191-1/+2
|
* cmd/geth, cmd/utils, core, rpc: renamed to blockchainJeffrey Wilcke2015-10-041-1/+1
| | | | | | * Renamed ChainManager to BlockChain * Checkpointing is no longer required and never really properly worked when the state was corrupted.
* eth, eth/downloader: don't report stall if fetcher filled the blockPéter Szilágyi2015-07-291-1/+1
|
* all: fix license headers one more timeFelix Lange2015-07-241-1/+1
| | | | I forgot to update one instance of "go-ethereum" in commit 3f047be5a.
* all: update license headers to distiguish GPL/LGPLFelix Lange2015-07-231-4/+4
| | | | | All code outside of cmd/ is licensed as LGPL. The headers now reflect this by calling the whole work "the go-ethereum library".
* all: update license informationFelix Lange2015-07-071-0/+16
|
* eth: clean up peer struct a bit, fix double txn bcastPéter Szilágyi2015-07-011-9/+1
|
* eth, eth/fetcher: separate notification sync mechanismPéter Szilágyi2015-06-181-137/+8
|
* eth, eth/downloader: fix processing interrupt caused by temp cancelPéter Szilágyi2015-06-181-1/+1
|
* eth: don't refetch non fitting blocks to avoid duplicatesPéter Szilágyi2015-06-151-1/+1
|
* eth, eth/downloader: do async block fetches, add dl testsPéter Szilágyi2015-06-151-1/+1
|
* eth, eth/downloader: move block processing into the downlaoderPéter Szilágyi2015-06-151-50/+3
|
* eth, eth/downloader: move peer removal into downloaderPéter Szilágyi2015-06-151-30/+2
|
* eth: dedup fetches to ensure no blocks are pulled twicePéter Szilágyi2015-06-111-5/+23
|
* eth: randomly fetch announced block (don't hammer origin)Péter Szilágyi2015-06-111-4/+5
|
* eth: discard fetched blocks that don't fit (no goroutine)Péter Szilágyi2015-06-111-13/+13
|
* eth: limit number of sent transactions based on message sizeFelix Lange2015-06-091-0/+94
| | | | | | | | | | | | | | Nodes that are out of sync will queue many transactions, which causes the initial transactions message to grow very large. Larger transactions messages can make communication impossible if the message is too big to send. Big transactions messages also exhaust egress bandwidth, which degrades other peer connections. The new approach to combat these issues is to send transactions in smaller batches. This commit introduces a new goroutine that handles delivery of all initial transaction transfers. Size-limited packs of transactions are sent to one peer at a time, conserving precious egress bandwidth.
* eth: fix a data race in the hash announcement processingPéter Szilágyi2015-06-091-10/+18
|
* eth: fix data race accessing peer.tdPéter Szilágyi2015-06-091-1/+1
|
* eth: fix data race accessing peer.recentHashPéter Szilágyi2015-06-091-3/+4
|
* eth: clean up pending announce download map, polish logsPéter Szilágyi2015-06-091-13/+25
|
* eth: split and handle explicitly vs. download requested blocksPéter Szilágyi2015-06-091-0/+56
|
* eth: fetch announced hashes from origin, periodicallyPéter Szilágyi2015-06-091-3/+55
|
* eth, eth/downloader: fix #1098, elevate empty hash errors to peer dropsPéter Szilágyi2015-06-051-1/+1
|
* core, eth/downloader: expose the bad hashes, check in downloaderPéter Szilágyi2015-05-281-2/+1
|
* core: check negative value transactions. Closes #1109obscuren2015-05-271-1/+0
|
* eth, eth/downloader: surface downloaded block origin, drop on errorPéter Szilágyi2015-05-261-3/+11
|
* expand acronym in log message from TDJason Carver2015-05-231-1/+1
| | | to total difficulty
* eth: make the peer set thread safePéter Szilágyi2015-05-191-17/+19
|
* eth, eth/downloader: detect and handle madeup hash attacksPéter Szilágyi2015-05-151-1/+1
|
* eth: drop a sync peer if it sends an invalid hash chainPéter Szilágyi2015-05-151-1/+1
|
* eth, eth/downloader: prevent hash repeater attackPéter Szilágyi2015-05-151-2/+4
|
* eth, eth/downloader: remove parent verification from the downlaoderPéter Szilágyi2015-05-141-9/+4
|
* eth, eth/downloader: handle a potential unknown parent attackPéter Szilágyi2015-05-141-6/+17
|
* eth, eth/downloader: moved pending queue error message to debugobscuren2015-05-111-1/+2
|
* eth: added a cancel method for the downloaderobscuren2015-05-101-0/+3
| | | | | | | | | Added a cancel method to the downloader which gracefully shuts down any active syncing process (hash fetching or block downloading) and resets the queue and remove any pending blocks. Issue with the downloader which would stall because of an active ongoing process when an invalid block was found.
* eth, eth/downloader: handle sync errors a bit more gracefullyPéter Szilágyi2015-05-081-26/+28
|
* eth, eth/downloader: make synchronize thread safePéter Szilágyi2015-05-081-12/+4
|
* cmd/geth, eth: bump version & tmp fix for incorrect TD peersobscuren2015-05-031-0/+7
|
* eth,core: changed NewTicker to Tickobscuren2015-05-031-4/+4
|
* eth, eth/downloader: Moved block processing & graceful shutdownobscuren2015-05-011-0/+101
The downloader is no longer responsible for processing blocks. The eth-protocol handler now takes care of this instead. Added graceful shutdown during block processing. Closes #846