Skip to content

Commit 34ead68

Browse files
authored
Merge pull request #22 from mudler/bump-libp2p-0.21.x
⬆️ Bump to go-libp2p 0.21.0
2 parents 9307c34 + eff5564 commit 34ead68

File tree

7 files changed

+118
-396
lines changed

7 files changed

+118
-396
lines changed

cmd/util.go

Lines changed: 15 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,14 @@ package cmd
1818
import (
1919
"encoding/json"
2020
"os"
21+
2122
"os/signal"
2223
"runtime"
2324
"syscall"
2425
"time"
2526

2627
"github.com/ipfs/go-log"
28+
rcmgr "github.com/libp2p/go-libp2p-resource-manager"
2729
"github.com/mudler/edgevpn/internal"
2830
"github.com/mudler/edgevpn/pkg/config"
2931
nodeConfig "github.com/mudler/edgevpn/pkg/config"
@@ -264,35 +266,6 @@ var CommonFlags []cli.Flag = []cli.Flag{
264266
Usage: "Enable resource manager. (Experimental) All options prefixed with limit requires resource manager to be enabled",
265267
EnvVar: "LIMITENABLE",
266268
},
267-
&cli.BoolFlag{
268-
Name: "limit-config-dynamic",
269-
Usage: "Enable dynamic resource limit configuration",
270-
EnvVar: "LIMITCONFIGDYNAMIC",
271-
},
272-
&cli.Int64Flag{
273-
Name: "limit-config-memory",
274-
Usage: "Memory resource limit configuration",
275-
EnvVar: "LIMITCONFIGMEMORY",
276-
Value: 128,
277-
},
278-
&cli.Float64Flag{
279-
Name: "limit-config-memory-fraction",
280-
Usage: "Fraction memory resource limit configuration (dynamic)",
281-
EnvVar: "LIMITCONFIGMEMORYFRACTION",
282-
Value: 10,
283-
},
284-
&cli.Int64Flag{
285-
Name: "limit-config-min-memory",
286-
Usage: "Minimum memory resource limit configuration (dynamic)",
287-
EnvVar: "LIMITCONFIGMINMEMORY",
288-
Value: 10,
289-
},
290-
&cli.Int64Flag{
291-
Name: "limit-config-max-memory",
292-
Usage: "Maximum memory resource limit configuration (dynamic)",
293-
EnvVar: "LIMITCONFIGMAXMEMORY",
294-
Value: 200,
295-
},
296269
&cli.IntFlag{
297270
Name: "limit-config-streams",
298271
Usage: "Streams resource limit configuration",
@@ -377,27 +350,26 @@ func displayStart(ll *logger.Logger) {
377350

378351
func cliToOpts(c *cli.Context) ([]node.Option, []vpn.Option, *logger.Logger) {
379352

380-
var limitConfig *node.NetLimitConfig
353+
var limitConfig *rcmgr.LimitConfig
381354

382355
autorelayInterval, err := time.ParseDuration(c.String("autorelay-discovery-interval"))
383356
if err != nil {
384357
autorelayInterval = 0
385358
}
386359

387360
if c.Bool("limit-config") {
388-
limitConfig = &node.NetLimitConfig{
389-
Dynamic: c.Bool("limit-config-dynamic"),
390-
Memory: c.Int64("limit-config-memory"),
391-
MinMemory: c.Int64("limit-config-min-memory"),
392-
MaxMemory: c.Int64("limit-config-max-memory"),
393-
MemoryFraction: c.Float64("limit-config-memory-fraction"),
394-
Streams: c.Int("limit-config-streams"),
395-
StreamsInbound: c.Int("limit-config-streams-inbound"),
396-
StreamsOutbound: c.Int("limit-config-streams-outbound"),
397-
Conns: c.Int("limit-config-conn"),
398-
ConnsInbound: c.Int("limit-config-conn-inbound"),
399-
ConnsOutbound: c.Int("limit-config-conn-outbound"),
400-
FD: c.Int("limit-config-fd"),
361+
limitConfig = &rcmgr.LimitConfig{
362+
363+
System: rcmgr.BaseLimit{
364+
Streams: c.Int("limit-config-streams"),
365+
StreamsInbound: c.Int("limit-config-streams-inbound"),
366+
StreamsOutbound: c.Int("limit-config-streams-outbound"),
367+
Conns: c.Int("limit-config-conn"),
368+
ConnsInbound: c.Int("limit-config-conn-inbound"),
369+
ConnsOutbound: c.Int("limit-config-conn-outbound"),
370+
FD: c.Int("limit-config-fd"),
371+
Memory: c.Int64("limit-config-memory"),
372+
},
401373
}
402374
}
403375

go.mod

Lines changed: 6 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -5,51 +5,38 @@ go 1.16
55
require (
66
github.com/Masterminds/sprig/v3 v3.2.2
77
github.com/benbjohnson/clock v1.3.0
8-
github.com/btcsuite/btcd/btcec/v2 v2.2.0 // indirect
98
github.com/c-robinson/iplib v1.0.3
109
github.com/cenkalti/backoff/v4 v4.1.3
11-
github.com/containerd/cgroups v1.0.4 // indirect
1210
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
13-
github.com/elastic/gosigar v0.14.2 // indirect
14-
github.com/fsnotify/fsnotify v1.5.4 // indirect
15-
github.com/godbus/dbus/v5 v5.1.0 // indirect
1611
github.com/google/btree v1.0.1 // indirect
1712
github.com/google/gopacket v1.1.19
18-
github.com/hashicorp/errwrap v1.1.0 // indirect
1913
github.com/hashicorp/golang-lru v0.5.4
2014
github.com/huandu/xstrings v1.3.2 // indirect
21-
github.com/huin/goupnp v1.0.3 // indirect
2215
github.com/imdario/mergo v0.3.13 // indirect
23-
github.com/ipfs/go-cid v0.2.0 // indirect
2416
github.com/ipfs/go-log v1.0.5
2517
github.com/ipfs/go-log/v2 v2.5.1
26-
github.com/ipld/go-ipld-prime v0.16.0 // indirect
2718
github.com/klauspost/compress v1.15.5 // indirect
28-
github.com/koron/go-ssdp v0.0.3 // indirect
2919
github.com/labstack/echo/v4 v4.7.2
30-
github.com/libp2p/go-libp2p v0.20.3
20+
github.com/libp2p/go-libp2p v0.21.0
3121
github.com/libp2p/go-libp2p-blankhost v0.4.0 // indirect
3222
github.com/libp2p/go-libp2p-connmgr v0.4.0 // indirect
33-
github.com/libp2p/go-libp2p-core v0.16.1
23+
github.com/libp2p/go-libp2p-core v0.19.1
3424
github.com/libp2p/go-libp2p-discovery v0.7.0 // indirect
35-
github.com/libp2p/go-libp2p-kad-dht v0.15.0
25+
github.com/libp2p/go-libp2p-kad-dht v0.16.1-0.20220702124207-e5a723647953
3626
github.com/libp2p/go-libp2p-pubsub v0.6.1
37-
github.com/libp2p/go-libp2p-resource-manager v0.3.0
27+
github.com/libp2p/go-libp2p-resource-manager v0.5.1
3828
github.com/libp2p/go-libp2p-swarm v0.11.0 // indirect
3929
github.com/mattn/go-colorable v0.1.12 // indirect
40-
github.com/miekg/dns v1.1.49
30+
github.com/miekg/dns v1.1.50
4131
github.com/mitchellh/copystructure v1.2.0 // indirect
4232
github.com/mudler/go-isterminal v0.0.0-20211031135732-5e4e06fc5a58
4333
github.com/mudler/go-processmanager v0.0.0-20211226182900-899fbb0b97f6
44-
github.com/multiformats/go-base32 v0.0.4 // indirect
45-
github.com/multiformats/go-multiaddr v0.5.0
46-
github.com/onsi/ginkgo v1.16.5 // indirect
34+
github.com/multiformats/go-multiaddr v0.6.0
4735
github.com/onsi/ginkgo/v2 v2.1.1
4836
github.com/onsi/gomega v1.17.0
4937
github.com/peterbourgon/diskv v2.0.1+incompatible
5038
github.com/pkg/errors v0.9.1
5139
github.com/prometheus/client_golang v1.12.2 // indirect
52-
github.com/prometheus/common v0.34.0 // indirect
5340
github.com/pterm/pterm v0.12.41
5441
github.com/shopspring/decimal v1.3.1 // indirect
5542
github.com/songgao/packets v0.0.0-20160404182456-549a10cd4091
@@ -59,18 +46,9 @@ require (
5946
github.com/vishvananda/netlink v1.1.0
6047
github.com/vishvananda/netns v0.0.0-20211101163701-50045581ed74 // indirect
6148
github.com/xlzd/gotp v0.0.0-20220110052318-fab697c03c2c
62-
go.uber.org/multierr v1.8.0 // indirect
63-
go.uber.org/zap v1.21.0 // indirect
64-
golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e // indirect
65-
golang.org/x/net v0.0.0-20220526153639-5463443f8c37 // indirect
6649
golang.org/x/sync v0.0.0-20220513210516-0976fa681c29 // indirect
6750
golang.org/x/term v0.0.0-20220526004731-065cf7ba2467 // indirect
68-
golang.org/x/tools v0.1.10 // indirect
69-
golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df // indirect
70-
google.golang.org/grpc v1.45.0 // indirect
71-
google.golang.org/protobuf v1.28.0 // indirect
7251
gopkg.in/yaml.v2 v2.4.0
73-
lukechampine.com/blake3 v1.1.7 // indirect
7452
)
7553

7654
replace github.com/elastic/gosigar => github.com/mudler/gosigar v0.14.3-0.20220502202347-34be910bdaaf

0 commit comments

Comments
 (0)