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

Connection Gating in a libp2p node #877

Closed
wants to merge 3 commits into from
Closed

Conversation

aarshkshah1992
Copy link
Contributor

For #872 .

Core PR at libp2p/go-libp2p-core#139.
Swarm PR at libp2p/go-libp2p-swarm#201.
Transport Upgrader PR at libp2p/go-libp2p-transport-upgrader#55.
MultiAddr Filter PR at libp2p/go-maddr-filter#21.

@aarshkshah1992 aarshkshah1992 requested a review from raulk April 7, 2020 11:43
@@ -4,7 +4,6 @@ import (
"context"
"crypto/rand"
"fmt"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the import block separation is desirable, i think

"github.com/libp2p/go-libp2p-core/connmgr"
"github.com/libp2p/go-libp2p-core/crypto"
"github.com/libp2p/go-libp2p-core/metrics"
"github.com/libp2p/go-libp2p-core/network"
"github.com/libp2p/go-libp2p-core/peer"
"github.com/libp2p/go-libp2p-core/peerstore"
"github.com/libp2p/go-libp2p-core/pnet"
"github.com/pkg/errors"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you don't need this dep. either the system built-in "errors" can be used for errors.New, or you can use the already included fmt for fmt.Errorf().

// ConnectionGater configures libp2p to use the given Connection Gater
// to reject incoming/outgoing connections based om the logic implemented in the gater.
// Note: This Option has replaced the earlier "Filters" AND "FilterAddresses" Options.
// Please use "filter.ToConnectionGater" to configure this of you already have an instance of a "go-maddr-filter.Filter".
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Please use "filter.ToConnectionGater" to configure this of you already have an instance of a "go-maddr-filter.Filter".
// Existing users of go-maddr-filter.Filter may use "filter.ToConnectionGater" for compatibility.

@aarshkshah1992
Copy link
Contributor Author

Closing in favour of #881 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants