-
-
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
update to libp2p 4.0.1 and propogate other changes #3284
Conversation
7cbb625
to
6158537
Compare
@@ -7,14 +7,14 @@ import ( | |||
"sync" | |||
"sync/atomic" | |||
|
|||
context "context" |
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.
This can be just "context"
up there with the other stdlib imports, same for the other occurences. Really no blocking issue though.
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, this is a result of a find/replace across the entire codebase. There are probably a hundred or so of these :/
@@ -68,7 +69,9 @@ var queryDhtCmd = &cmds.Command{ | |||
events := make(chan *notif.QueryEvent) | |||
ctx := notif.RegisterForQueryEvents(req.Context(), events) | |||
|
|||
closestPeers, err := dht.GetClosestPeers(ctx, key.Key(req.Arguments()[0])) | |||
k := string(b58.Decode(req.Arguments()[0])) |
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.
Any reason for the string cast? It's fine, just wondering.
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.
b58.Decode returns bytes, i needed a string
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.
This actually is a bugfix. Previously we we'rent base58 decoding this like we were supposed to.
ipnskey := key.Key("/ipns/" + id) | ||
func IpnsKeysForID(id peer.ID) (name, ipns string) { | ||
namekey := "/pk/" + string(id) | ||
ipnskey := "/ipns/" + string(id) |
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.
Where is the changed caller of this?
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.
In:
- core/commands/dht_test.go:12
- namesys/publisher.go:68
- namesys/publisher.go:141
- namesys/republisher/repub.go:90
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.
Got it thanks! LGTM 👍
func (p *ipnsPublisher) getPreviousSeqNo(ctx context.Context, ipnskey key.Key) (uint64, error) { | ||
prevrec, err := p.ds.Get(ipnskey.DsKey()) | ||
func (p *ipnsPublisher) getPreviousSeqNo(ctx context.Context, ipnskey string) (uint64, error) { | ||
prevrec, err := p.ds.Get(dshelp.NewKeyFromBinary(ipnskey)) |
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.
Ah here's the changed caller for IpnsKeysForID()
, so to speak.
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 I mean is here's the function that gets the return from IpnsKeysForID()
and which got the signature change
ipnskey := key.Key("/ipns/" + id) | ||
func IpnsKeysForID(id peer.ID) (name, ipns string) { | ||
namekey := "/pk/" + string(id) | ||
ipnskey := "/ipns/" + string(id) |
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.
Got it thanks! LGTM 👍
License: MIT Signed-off-by: Jeromy <[email protected]>
60546d2
to
1f9ec4e
Compare
update to libp2p 4.0.1 and propogate other changes This commit was moved from ipfs/kubo@67a1b3e
cc @Kubuxu @lgierth
License: MIT
Signed-off-by: Jeromy [email protected]