aboutsummaryrefslogtreecommitdiffstats
path: root/les/odr.go
Commit message (Collapse)AuthorAgeFilesLines
* les, les/flowcontrol: improved request serving and flow control (#18230)Felföldi Zsolt2019-02-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | This change - implements concurrent LES request serving even for a single peer. - replaces the request cost estimation method with a cost table based on benchmarks which gives much more consistent results. Until now the allowed number of light peers was just a guess which probably contributed a lot to the fluctuating quality of available service. Everything related to request cost is implemented in a single object, the 'cost tracker'. It uses a fixed cost table with a global 'correction factor'. Benchmark code is included and can be run at any time to adapt costs to low-level implementation changes. - reimplements flowcontrol.ClientManager in a cleaner and more efficient way, with added capabilities: There is now control over bandwidth, which allows using the flow control parameters for client prioritization. Target utilization over 100 percent is now supported to model concurrent request processing. Total serving bandwidth is reduced during block processing to prevent database contention. - implements an RPC API for the LES servers allowing server operators to assign priority bandwidth to certain clients and change prioritized status even while the client is connected. The new API is meant for cases where server operators charge for LES using an off-protocol mechanism. - adds a unit test for the new client manager. - adds an end-to-end test using the network simulator that tests bandwidth control functions through the new API.
* les: implement ultralight client (#16904)b00ris2019-01-241-1/+4
| | | | For more information about this light client mode, read https://hackmd.io/s/HJy7jjZpm
* all: make indexer configurable (#17188)gary rong2018-08-281-4/+11
|
* light: CHT and bloom trie indexers working in light mode (#16534)Felföldi Zsolt2018-08-161-7/+11
| | | | | | | This PR enables the indexers to work in light client mode by downloading a part of these tries (the Merkle proofs of the last values of the last known section) in order to be able to add new values and recalculate subsequent hashes. It also adds CHT data to NodeInfo.
* all: gofmt -w -s (#15419)ferhat elmas2017-11-081-9/+9
|
* les, light: LES/2 protocol version (#14970)Felföldi Zsolt2017-10-241-11/+35
| | | | | | | | | | | | | | | | | | This PR implements the new LES protocol version extensions: * new and more efficient Merkle proofs reply format (when replying to a multiple Merkle proofs request, we just send a single set of trie nodes containing all necessary nodes) * BBT (BloomBitsTrie) works similarly to the existing CHT and contains the bloombits search data to speed up log searches * GetTxStatusMsg returns the inclusion position or the pending/queued/unknown state of a transaction referenced by hash * an optional signature of new block data (number/hash/td) can be included in AnnounceMsg to provide an option for "very light clients" (mobile/embedded devices) to skip expensive Ethash check and accept multiple signatures of somewhat trusted servers (still a lot better than trusting a single server completely and retrieving everything through RPC). The new client mode is not implemented in this PR, just the protocol extension.
* les: code refactoring (#14416)Felföldi Zsolt2017-06-211-180/+15
| | | | | | | | | | | | This commit does various code refactorings: - generalizes and moves the request retrieval/timeout/resend logic out of LesOdr (will be used by a subsequent PR) - reworks the peer management logic so that all services can register with peerSet to get notified about added/dropped peers (also gets rid of the ugly getAllPeers callback in requestDistributor) - moves peerSet, LesOdr, requestDistributor and retrieveManager initialization out of ProtocolManager because I believe they do not really belong there and the whole init process was ugly and ad-hoc
* all: import "context" instead of "golang.org/x/net/context"Felix Lange2017-03-231-1/+1
| | | | | | | | | | There is no need to depend on the old context package now that the minimum Go version is 1.7. The move to "context" eliminates our weird vendoring setup. Some vendored code still uses golang.org/x/net/context and it is now vendored in the normal way. This change triggered new vet checks around context.WithTimeout which didn't fire with golang.org/x/net/context.
* les: implement request distributor, fix blocking issues (#3660)Felföldi Zsolt2017-03-231-44/+55
| | | | | * les: implement request distributor, fix blocking issues * core: moved header validation before chain mutex lock
* all: update light logs (and a few others) to the new modelPéter Szilágyi2017-03-031-17/+16
|
* all: blidly swap out glog to our log15, logs need reworkPéter Szilágyi2017-02-231-4/+4
|
* les: fixed selectPeer deadlock, improved request distributionZsolt Felfoldi2017-01-061-4/+6
| | | | les/flowcontrol: using proper types for relative and absolute times
* les, light: add block availability check for ODR requestsZsolt Felfoldi2016-12-101-0/+3
|
* les: using random request IDsZsolt Felfoldi2016-12-101-8/+7
|
* les: improved header fetcher and server statisticsZsolt Felfoldi2016-12-101-29/+26
|
* all: update license informationFelix Lange2016-11-091-1/+2
|
* les: light client protocol and APIZsolt Felfoldi2016-11-091-0/+247