Skip to content

PNet take 2#3697

Merged
whyrusleeping merged 3 commits intomasterfrom
feat/pnet2
Mar 2, 2017
Merged

PNet take 2#3697
whyrusleeping merged 3 commits intomasterfrom
feat/pnet2

Conversation

@Kubuxu
Copy link
Copy Markdown
Member

@Kubuxu Kubuxu commented Feb 16, 2017

No description provided.

@Kubuxu Kubuxu added the status/in-progress In progress label Feb 16, 2017
@Kubuxu Kubuxu force-pushed the feat/pnet2 branch 2 times, most recently from a70886b to 74305d4 Compare February 16, 2017 17:06
Copy link
Copy Markdown
Member

@whyrusleeping whyrusleeping left a comment

Choose a reason for hiding this comment

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

Overall looks good to me. I'd like to see it squashed into two commits, the first just updating deps, and the second making all the code changes, then i'll review again.

Comment thread core/commands/swarm.go
"github.com/ipfs/go-ipfs/repo/fsrepo"
iaddr "github.com/ipfs/go-ipfs/thirdparty/ipfsaddr"
pstore "gx/ipfs/QmQMQ2RUjnaEEX8ybmrhuFFGhAwPjyL1Eo6ZoJGD7aAccM/go-libp2p-peerstore"
swarm "gx/ipfs/QmY8hduizbuACvYmL4aZQbpFeKhEQJ1Nom2jY6kv6rL8Gf/go-libp2p-swarm"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lets keep all the dep updates in the same commit

@Kubuxu Kubuxu force-pushed the feat/pnet2 branch 2 times, most recently from 2077a9d to b217609 Compare February 17, 2017 12:45
@Kubuxu
Copy link
Copy Markdown
Member Author

Kubuxu commented Feb 17, 2017

Done.

Copy link
Copy Markdown
Member

@whyrusleeping whyrusleeping left a comment

Choose a reason for hiding this comment

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

LGTM, Just one weird merge conflict thing with the dependency updating commit. Gotta make sure every commit at least builds

Comment thread core/core.go Outdated

tpt := makeSmuxTransport(mplex)

<<<<<<< HEAD
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Merge conflict here.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Sorry that I have missed it.

Comment thread core/core.go
case <-t.C:
if ph := n.PeerHost; ph != nil {
if len(ph.Network().Peers()) == 0 {
log.Warning("We are in private network and have no peers.")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Rather unfortunate that these warnings won't show up by default... I wonder if we should look at turning on warning messages by default?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I think it might be good idea, there doesn't seem that much of a spam on warning level.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I take it back, there is a lot of spam on global warning channel.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hrm... definitely out of scope for this PR, but we should look at reducing spam there and think about setting the default level to be warning

@Kubuxu Kubuxu force-pushed the feat/pnet2 branch 2 times, most recently from df2ae38 to 4acf869 Compare February 21, 2017 13:41
@Kubuxu
Copy link
Copy Markdown
Member Author

Kubuxu commented Feb 21, 2017

Fixed the merge conflict and rebased.

@Kubuxu
Copy link
Copy Markdown
Member Author

Kubuxu commented Feb 21, 2017

Coverage is a bit low, as the lack of peer warning isn't tested. There is no clean way to test it and as it is just a log I don't think it matters.

@Kubuxu Kubuxu added this to the Ipfs 0.4.7 milestone Feb 21, 2017
Comment thread cmd/ipfs/daemon.go Outdated

if node.PNetFingerpint != nil {
fmt.Println("Swarm is limited to private network of peers with the swarm key")
fmt.Printf("Swarm key fingerprint: %s\n", hex.EncodeToString(node.PNetFingerpint))
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

you can just use %x

License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
Comment thread core/core.go

// isolates the complex initialization steps
func constructPeerHost(ctx context.Context, id peer.ID, ps pstore.Peerstore, bwr metrics.Reporter, fs []*net.IPNet, tpt smux.Transport) (p2phost.Host, error) {
func constructPeerHost(ctx context.Context, id peer.ID, ps pstore.Peerstore, bwr metrics.Reporter, fs []*net.IPNet, tpt smux.Transport, protec ipnet.Protector) (p2phost.Host, error) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

At some point (not now) I want to make this more simply composed

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yeah, we should probably change it to be struct instead of function args.

@whyrusleeping
Copy link
Copy Markdown
Member

LGTM, lets ship this in 0.4.7

@Kubuxu Kubuxu added RFM and removed status/in-progress In progress labels Feb 22, 2017
@whyrusleeping whyrusleeping merged commit dd9584b into master Mar 2, 2017
@whyrusleeping whyrusleeping deleted the feat/pnet2 branch March 2, 2017 00:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants