Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Downgrade libp2p to 0.17.0 #8233

Merged
merged 28 commits into from
Mar 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
5329f18
Revert "update go-libp2p to v0.18.0-rc5"
arajasek Mar 2, 2022
7207740
Revert "update libp2p to v0.18.0-rc4"
arajasek Mar 2, 2022
94678ba
Revert "update go-libp2p to v0.18.0-rc3"
arajasek Mar 2, 2022
2aab4d4
Revert "update go-libp2p to v0.18.0-rc2"
arajasek Mar 2, 2022
6dc696b
Revert "feat: update to go-fil-markets v1.19.0"
arajasek Mar 2, 2022
17ac583
Revert "close the rcmgr on shutdown"
arajasek Mar 2, 2022
48e2889
Revert "fix lint"
arajasek Mar 2, 2022
7dbf0ce
Revert "make gen and friends"
arajasek Mar 2, 2022
bf0470a
Revert "fix issues with fil-markets/data-transfer updates"
arajasek Mar 2, 2022
a7e02f7
Revert "update [email protected]"
arajasek Mar 2, 2022
ce040b7
Revert "add description for net stat and limit commands"
arajasek Mar 2, 2022
4968bab
Revert "go mod: update [email protected]"
arajasek Mar 2, 2022
581cb34
Revert "go mod: update [email protected]"
arajasek Mar 2, 2022
e49d499
Revert "fix mocknet.New invocation"
arajasek Mar 2, 2022
f281027
Revert "fix mocknet.New invocation"
arajasek Mar 2, 2022
f9f6f35
Revert "go mod: update go-libp2p-pubsub"
arajasek Mar 2, 2022
11fc068
Revert "go mod: [email protected]"
arajasek Mar 2, 2022
99e1b9e
Revert "add net stat and limit cli"
arajasek Mar 2, 2022
bac1706
Revert "add examples to docgen"
arajasek Mar 2, 2022
b8747e3
Revert "add resource manager Net(Set)Limit api"
arajasek Mar 2, 2022
e9e28f7
Revert "add resource manager NetStat api"
arajasek Mar 2, 2022
b5912d1
Revert "instantiate resource manager in DI"
arajasek Mar 2, 2022
8588628
Revert "use the libp2p connmgr"
arajasek Mar 2, 2022
04f2d35
Revert "go mod: go-libp2p-resource-manager"
arajasek Mar 2, 2022
08bbfed
Revert "go mod: [email protected]"
arajasek Mar 2, 2022
898f523
Upgrade to go-data-transfer 1.14.1
arajasek Mar 2, 2022
1bc1cd3
Upgrade to go-fil-markets 1.19.2
arajasek Mar 2, 2022
ebe1ca7
make gen
arajasek Mar 2, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions api/api_net.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,6 @@ type Net interface {
NetBlockRemove(ctx context.Context, acl NetBlockList) error //perm:admin
NetBlockList(ctx context.Context) (NetBlockList, error) //perm:read

// ResourceManager API
NetStat(ctx context.Context, scope string) (NetStat, error) //perm:read
NetLimit(ctx context.Context, scope string) (NetLimit, error) //perm:read
NetSetLimit(ctx context.Context, scope string, limit NetLimit) error //perm:admin

// ID returns peerID of libp2p node backing this API
ID(context.Context) (peer.ID, error) //perm:read
}
Expand Down
28 changes: 0 additions & 28 deletions api/docgen/docgen.go
Original file line number Diff line number Diff line change
Expand Up @@ -300,34 +300,6 @@ func init() {
Error: "<error>",
})
addExample(storiface.ResourceTable)
addExample(network.ScopeStat{
Memory: 123,
NumStreamsInbound: 1,
NumStreamsOutbound: 2,
NumConnsInbound: 3,
NumConnsOutbound: 4,
NumFD: 5,
})
addExample(map[string]network.ScopeStat{
"abc": {
Memory: 123,
NumStreamsInbound: 1,
NumStreamsOutbound: 2,
NumConnsInbound: 3,
NumConnsOutbound: 4,
NumFD: 5,
}})
addExample(api.NetLimit{
Memory: 123,
StreamsInbound: 1,
StreamsOutbound: 2,
Streams: 3,
ConnsInbound: 3,
ConnsOutbound: 4,
Conns: 4,
FD: 5,
})

}

func GetAPIType(name, pkg string) (i interface{}, t reflect.Type, permStruct []reflect.Type) {
Expand Down
44 changes: 0 additions & 44 deletions api/mocks/mock_full.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

39 changes: 0 additions & 39 deletions api/proxy_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 0 additions & 23 deletions api/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import (
"github.com/ipfs/go-cid"
"github.com/ipfs/go-graphsync"

"github.com/libp2p/go-libp2p-core/network"
"github.com/libp2p/go-libp2p-core/peer"
pubsub "github.com/libp2p/go-libp2p-pubsub"
ma "github.com/multiformats/go-multiaddr"
Expand Down Expand Up @@ -130,28 +129,6 @@ type NetBlockList struct {
IPSubnets []string
}

type NetStat struct {
System *network.ScopeStat `json:",omitempty"`
Transient *network.ScopeStat `json:",omitempty"`
Services map[string]network.ScopeStat `json:",omitempty"`
Protocols map[string]network.ScopeStat `json:",omitempty"`
Peers map[string]network.ScopeStat `json:",omitempty"`
}

type NetLimit struct {
Dynamic bool `json:",omitempty"`
// set if Dynamic is false
Memory int64 `json:",omitempty"`
// set if Dynamic is true
MemoryFraction float64 `json:",omitempty"`
MinMemory int64 `json:",omitempty"`
MaxMemory int64 `json:",omitempty"`

Streams, StreamsInbound, StreamsOutbound int
Conns, ConnsInbound, ConnsOutbound int
FD int
}

type ExtendedPeerInfo struct {
ID peer.ID
Agent string
Expand Down
44 changes: 0 additions & 44 deletions api/v0api/v0mocks/mock_full.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified build/openrpc/full.json.gz
Binary file not shown.
Binary file modified build/openrpc/miner.json.gz
Binary file not shown.
Binary file modified build/openrpc/worker.json.gz
Binary file not shown.
4 changes: 2 additions & 2 deletions chain/sync_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ func prepSyncTest(t testing.TB, h int) *syncTestUtil {
ctx: ctx,
cancel: cancel,

mn: mocknet.New(),
mn: mocknet.New(ctx),
g: g,
us: filcns.DefaultUpgradeSchedule(),
}
Expand Down Expand Up @@ -158,7 +158,7 @@ func prepSyncTestWithV5Height(t testing.TB, h int, v5height abi.ChainEpoch) *syn
ctx: ctx,
cancel: cancel,

mn: mocknet.New(),
mn: mocknet.New(ctx),
g: g,
us: sched,
}
Expand Down
102 changes: 0 additions & 102 deletions cli/net.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ var NetCmd = &cli.Command{
NetReachability,
NetBandwidthCmd,
NetBlockCmd,
NetStatCmd,
NetLimitCmd,
},
}

Expand Down Expand Up @@ -608,103 +606,3 @@ var NetBlockListCmd = &cli.Command{
return nil
},
}

var NetStatCmd = &cli.Command{
Name: "stat",
Usage: "Report resource usage for a scope",
ArgsUsage: "scope",
Description: `Report resource usage for a scope.

The scope can be one of the following:
- system -- reports the system aggregate resource usage.
- transient -- reports the transient resource usage.
- svc:<service> -- reports the resource usage of a specific service.
- proto:<proto> -- reports the resource usage of a specific protocol.
- peer:<peer> -- reports the resource usage of a specific peer.
- all -- reports the resource usage for all currently active scopes.
`,
Action: func(cctx *cli.Context) error {
api, closer, err := GetAPI(cctx)
if err != nil {
return err
}
defer closer()
ctx := ReqContext(cctx)

args := cctx.Args().Slice()
if len(args) != 1 {
return xerrors.Errorf("must specify exactly one scope")
}
scope := args[0]

result, err := api.NetStat(ctx, scope)
if err != nil {
return err
}

enc := json.NewEncoder(os.Stdout)
return enc.Encode(result)
},
}

var NetLimitCmd = &cli.Command{
Name: "limit",
Usage: "Get or set resource limits for a scope",
ArgsUsage: "scope [limit]",
Description: `Get or set resource limits for a scope.

The scope can be one of the following:
- system -- reports the system aggregate resource usage.
- transient -- reports the transient resource usage.
- svc:<service> -- reports the resource usage of a specific service.
- proto:<proto> -- reports the resource usage of a specific protocol.
- peer:<peer> -- reports the resource usage of a specific peer.

The limit is json-formatted, with the same structure as the limits file.
`,
Flags: []cli.Flag{
&cli.BoolFlag{
Name: "set",
Usage: "set the limit for a scope",
},
},
Action: func(cctx *cli.Context) error {
api, closer, err := GetAPI(cctx)
if err != nil {
return err
}
defer closer()
ctx := ReqContext(cctx)
args := cctx.Args().Slice()

if cctx.Bool("set") {
if len(args) != 2 {
return xerrors.Errorf("must specify exactly a scope and a limit")
}
scope := args[0]
limitStr := args[1]

var limit atypes.NetLimit
err := json.Unmarshal([]byte(limitStr), &limit)
if err != nil {
return xerrors.Errorf("error decoding limit: %w", err)
}

return api.NetSetLimit(ctx, scope, limit)

}

if len(args) != 1 {
return xerrors.Errorf("must specify exactly one scope")
}
scope := args[0]

result, err := api.NetLimit(ctx, scope)
if err != nil {
return err
}

enc := json.NewEncoder(os.Stdout)
return enc.Encode(result)
},
}
Loading