aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/utils/flags.go
diff options
context:
space:
mode:
authorFelföldi Zsolt <zsfelfoldi@gmail.com>2019-02-26 19:32:48 +0800
committerFelix Lange <fjl@users.noreply.github.com>2019-02-26 19:32:48 +0800
commitc2003ed63b975c6318e4dd7e65b69c60777b0ddf (patch)
tree0045c39070c4d2b9fcaa93cbcbdd8d5ea4f4a29f /cmd/utils/flags.go
parentc2b33a117f686069e36d58d937e1c75d72d7b94c (diff)
downloadgo-tangerine-c2003ed63b975c6318e4dd7e65b69c60777b0ddf.tar
go-tangerine-c2003ed63b975c6318e4dd7e65b69c60777b0ddf.tar.gz
go-tangerine-c2003ed63b975c6318e4dd7e65b69c60777b0ddf.tar.bz2
go-tangerine-c2003ed63b975c6318e4dd7e65b69c60777b0ddf.tar.lz
go-tangerine-c2003ed63b975c6318e4dd7e65b69c60777b0ddf.tar.xz
go-tangerine-c2003ed63b975c6318e4dd7e65b69c60777b0ddf.tar.zst
go-tangerine-c2003ed63b975c6318e4dd7e65b69c60777b0ddf.zip
les, les/flowcontrol: improved request serving and flow control (#18230)
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.
Diffstat (limited to 'cmd/utils/flags.go')
-rw-r--r--cmd/utils/flags.go14
1 files changed, 13 insertions, 1 deletions
diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go
index 5b8ebb481..4db59097d 100644
--- a/cmd/utils/flags.go
+++ b/cmd/utils/flags.go
@@ -199,9 +199,19 @@ var (
}
LightServFlag = cli.IntFlag{
Name: "lightserv",
- Usage: "Maximum percentage of time allowed for serving LES requests (0-90)",
+ Usage: "Maximum percentage of time allowed for serving LES requests (multi-threaded processing allows values over 100)",
Value: 0,
}
+ LightBandwidthInFlag = cli.IntFlag{
+ Name: "lightbwin",
+ Usage: "Incoming bandwidth limit for light server (1000 bytes/sec, 0 = unlimited)",
+ Value: 1000,
+ }
+ LightBandwidthOutFlag = cli.IntFlag{
+ Name: "lightbwout",
+ Usage: "Outgoing bandwidth limit for light server (1000 bytes/sec, 0 = unlimited)",
+ Value: 5000,
+ }
LightPeersFlag = cli.IntFlag{
Name: "lightpeers",
Usage: "Maximum number of LES client peers",
@@ -1305,6 +1315,8 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *eth.Config) {
if ctx.GlobalIsSet(LightServFlag.Name) {
cfg.LightServ = ctx.GlobalInt(LightServFlag.Name)
}
+ cfg.LightBandwidthIn = ctx.GlobalInt(LightBandwidthInFlag.Name)
+ cfg.LightBandwidthOut = ctx.GlobalInt(LightBandwidthOutFlag.Name)
if ctx.GlobalIsSet(LightPeersFlag.Name) {
cfg.LightPeers = ctx.GlobalInt(LightPeersFlag.Name)
}