-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
The Peer is Dead. Long live the ID #466
Conversation
@maybebtc specifically, there's a test case inside |
return nil, err | ||
return | ||
} | ||
p = peer.PeerInfo{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why a PeerInfo
rather than peerstore.Addresses(pid)
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i could switch it to peer.ID
. i thought (id, addr)
bundle was wanted, but turned out it wasn't. either way
Did this take care of #463 ? |
Super confused by this. Digging deeper... edit: a2f321f |
if err := self.LoadAndVerifyKeyPair(skb); err != nil { | ||
return nil, err | ||
var id2 peer.ID | ||
id2, err = peer.IDFromPrivateKey(sk) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is sk
a bug? should it be sk2
?
Not yet. edit: I was planning on rebasing it on top of this. |
934d5a4
to
683e23c
Compare
👏 👏 👏 Hard to figure out what was wrong. :/ the lambdas made it hard to know where things were actually panicing. |
683e23c
to
0d760a9
Compare
// commenting out for now. i'm not sure this is correct -jbenet | ||
// // TODO decide on providers. This probably shouldn't be happening. | ||
// // TODO what did "this" mean? i think it's the notion of receiving | ||
// // a list of providers and then immediately requesting that value |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, youre right on this. We can remove this code entirely
Theres a lot of changes here, but skimming through it all, it looks pretty good to me. |
this is one where careful look would be hugely valuable. a ton of important changes. @maybebtc already caught a couple errors, im sure I've made more. I'll look over it again, but more pairs of eyes would help. |
@@ -102,8 +100,8 @@ func TestCanceledContext(t *testing.T) { | |||
i := 0 | |||
go func() { // infinite stream | |||
for { | |||
peer := testutil.NewPeerWithIDString(string(i)) | |||
err := rs.Client(peer).Provide(context.Background(), k) | |||
pi := peer.PeerInfo{ID: peer.ID(i)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know this is a refactor, but it looks like this isnt being cleaned up after
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what do you mean? (not seeing it)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The infinite loop in a goroutine, that goroutine wont ever exit. which i guess is okay for tests, but they do build up when you do go test ./...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh, good catch, thanks 4b15204
filing a complaint against the title, should be "The Peer is dead, Long live the Peer!" |
Alright, read over it all. It does all look pretty good with the changes youve made. |
Would you be down to squash this so everything builds? |
@maybebtc not everything, but yes the non building things. |
@maybebtc help me fix the test first though -- oh damn i've been posting on the wrong issue. #463 (comment) should be here Reproduced here: Now i'm getting this.
Full log here: https://gist.github.com/jbenet/34db7858b7849153197f Another interesting portion:
|
17fe066
to
5e475e1
Compare
the plot thickens, from the output it looks like the nodes aren't connecting. |
Oh silliness, bitten by my own bug, i should be debugging on #463 as that fixes the bootstrapping. sec. |
License: MIT Signed-off-by: Brian Tiger Chow <[email protected]>
cc @jbenet @whyrusleeping License: MIT Signed-off-by: Brian Tiger Chow <[email protected]>
"Get" is still fairly useful. Leaving it there. License: MIT Signed-off-by: Brian Tiger Chow <[email protected]>
License: MIT Signed-off-by: Brian Tiger Chow <[email protected]>
https://build.protocol-dev.com/job/race/9352/console @jbenet @whyrusleeping pinging you guys to spread awareness about the delay.D type for configurable delays License: MIT Signed-off-by: Brian Tiger Chow <[email protected]>
network.ListenAddresses() are general. Interface addresses are specific.
Had to change the network interface from DialPeer(peer.ID) to DialPeer(peer.PeerInfo), so that addresses of a provider are handed to the network. @maybebtc and I are discussing whether this should go all the way down to the network, or whether the network _should always work_ with just an ID (which means the network needs to be able to resolve ID -> Addresses, using the routing system. This latter point might mean that "routing" might need to break down into subcomponents. It's a bit sketchy that the Network would become smarter than just dial/listen and I/O, but maybe there's a distinction between net.Network, and something like a peernet.Network that has routing built in...)
This reverts commit bf88f1a.
…outing @jbenet @whyrusleeping the next commit will change bitswap.Network.FindProviders to only deal with IDs
@jbenet @whyrusleeping This commit replaces peer.PeerInfo with peer.ID in the bitswap package
4d685c2
to
a5018fc
Compare
The Peer is Dead. Long live the ID
Warning: the dht doesn't work. Merging this in as To update you, @whyrusleeping tests pass, but the docker test doesn't. And, try spinning up three instances like below. resolving doesn't work, and not sure why. |
fix(dialqueue): fix a timer leak
This PR is a massive refactor, removing peer.Peer
everywhere and using peer.ID instead. This refactor
also revealed a number of bugs throughout that i
fixed. Sadly, i'm sure i'll introduce some-- this is
a pretty large refactor. The upside is that everything
is saner when it comes to peers and the peerstore.
They feel much better now.
Note: I will squash most of this PR so that it is
bisectable.
@maybebtc @whyrusleeping could use CR. multiple eyes
looking over it would be ideal.