bsc/common
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
..
bitutil various: remove redundant parentheses (#15793) 2018-01-03 14:14:47 +02:00
compiler cmd/abigen: support for reading solc output from stdin (#16683) 2018-06-05 12:22:02 +02:00
fdlimit all: update license information (#16089) 2018-02-14 13:49:11 +01:00
hexutil common: all golint warnings removed (#16852) 2018-06-14 12:52:50 +03:00
math common: all golint warnings removed (#16852) 2018-06-14 12:52:50 +03:00
mclock les: implement client connection logic (#16899) 2018-08-14 22:44:46 +02:00
prque les: implement client connection logic (#16899) 2018-08-14 22:44:46 +02:00
big.go core, vm, common: define constantinople fork + shift (#16045) 2018-02-23 12:32:57 +02:00
bytes_test.go common: improve IsHexAddress and add tests (#15551) 2017-12-04 19:34:15 +01:00
bytes.go common: improve documentation comments (#16701) 2018-05-29 12:42:21 +02:00
debug.go core: added basic chain configuration 2016-04-01 01:01:10 +02:00
format.go all: fix issues reported by honnef.co/go/simple/cmd/gosimple 2017-01-06 18:18:07 +01:00
main_test.go all: fix license headers one more time 2015-07-23 18:35:11 +02:00
path.go common: improve documentation comments (#16701) 2018-05-29 12:42:21 +02:00
size_test.go common: move big integer math to common/math (#3699) 2017-02-26 22:21:51 +01:00
size.go core, trie: intermediate mempool between trie and database (#15857) 2018-02-05 17:40:32 +01:00
test_utils.go all: fix license headers one more time 2015-07-23 18:35:11 +02:00
types_test.go common: add database/sql support for Hash and Address (#15541) 2018-07-24 15:15:07 +02:00
types.go common: add database/sql support for Hash and Address (#15541) 2018-07-24 15:15:07 +02:00