quorum/les
Felföldi Zsolt b2ddb1fcbf les: implement client connection logic (#16899)
This PR implements les.freeClientPool. It also adds a simulated clock
in common/mclock, which enables time-sensitive tests to run quickly
and still produce accurate results, and package common/prque which is
a generalised variant of prque that enables removing elements other
than the top one from the queue.

les.freeClientPool implements a client database that limits the
connection time of each client and manages accepting/rejecting
incoming connections and even kicking out some connected clients. The
pool calculates recent usage time for each known client (a value that
increases linearly when the client is connected and decreases
exponentially when not connected). Clients with lower recent usage are
preferred, unknown nodes have the highest priority. Already connected
nodes receive a small bias in their favor in order to avoid accepting
and instantly kicking out clients.

Note: the pool can use any string for client identification. Using
signature keys for that purpose would not make sense when being known
has a negative value for the client. Currently the LES protocol
manager uses IP addresses (without port address) to identify clients.
2018-08-14 22:44:46 +02:00
..
flowcontrol les: fix megacheck warnings (#14941) 2017-08-08 19:31:08 +03:00
api_backend.go accounts, eth, les: blockhash based filtering on all code paths 2018-07-12 18:16:54 +03:00
backend.go cmd, consensus/ethash, eth: miner push notifications 2018-08-10 09:06:59 +03:00
bloombits.go build: enable goimports and varcheck linters (#16446) 2018-04-18 00:53:50 +02:00
distributor.go all: gofmt -w -s (#15419) 2017-11-08 11:45:52 +01:00
distributor_test.go les: changed if-else blocks to conform with golint (#16658) 2018-05-03 11:35:06 +03:00
execqueue.go les: fix goroutine leak in execQueue (#14480) 2017-05-16 20:56:02 +02:00
execqueue_test.go les: fix goroutine leak in execQueue (#14480) 2017-05-16 20:56:02 +02:00
fetcher.go les: add announcement safety check to light fetcher (#17034) 2018-07-04 13:40:20 +03:00
freeclient.go les: implement client connection logic (#16899) 2018-08-14 22:44:46 +02:00
freeclient_test.go les: implement client connection logic (#16899) 2018-08-14 22:44:46 +02:00
handler.go les: implement client connection logic (#16899) 2018-08-14 22:44:46 +02:00
handler_test.go all: get rid of error when creating memory database (#16716) 2018-05-09 15:24:25 +03:00
helper_test.go les: pass server pool to protocol manager (#16947) 2018-06-12 14:00:52 +03:00
metrics.go metrics: pull library and introduce ResettingTimer and InfluxDB reporter (#15910) 2018-02-23 11:56:08 +02:00
odr.go all: gofmt -w -s (#15419) 2017-11-08 11:45:52 +01:00
odr_requests.go trie: fixes to comply with golint (#16771) 2018-05-21 23:41:31 +03:00
odr_test.go all: get rid of error when creating memory database (#16716) 2018-05-09 15:24:25 +03:00
peer.go les: add ps.lock.Unlock() before return (#16360) 2018-04-11 11:02:33 +03:00
protocol.go core/rawdb: separate raw database access to own package (#16666) 2018-05-07 14:35:06 +03:00
randselect.go les: changed if-else blocks to conform with golint (#16658) 2018-05-03 11:35:06 +03:00
randselect_test.go all: gofmt -w -s 2017-01-06 15:52:03 +01:00
request_test.go all: get rid of error when creating memory database (#16716) 2018-05-09 15:24:25 +03:00
retrieve.go les: fix retriever logic (#16776) 2018-06-12 15:58:47 +02:00
server.go les: pass server pool to protocol manager (#16947) 2018-06-12 14:00:52 +03:00
serverpool.go les: handle conn/disc/reg logic in the eventloop (#16981) 2018-06-25 11:52:24 +03:00
sync.go core/rawdb: separate raw database access to own package (#16666) 2018-05-07 14:35:06 +03:00
txrelay.go les: code refactoring (#14416) 2017-06-21 12:27:38 +02:00