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

update to libp2p 4.0.1 and propogate other changes #3284

Merged
merged 1 commit into from
Oct 6, 2016

Conversation

whyrusleeping
Copy link
Member

cc @Kubuxu @lgierth

License: MIT
Signed-off-by: Jeromy why@ipfs.io

@@ -7,14 +7,14 @@ import (
"sync"
"sync/atomic"

context "context"
Copy link

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.

Copy link
Member Author

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]))
Copy link

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.

Copy link
Member Author

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

Copy link
Member Author

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)
Copy link

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?

Copy link
Member Author

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

Copy link

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))
Copy link

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.

Copy link

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)
Copy link

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 <why@ipfs.io>
@whyrusleeping whyrusleeping merged commit 67a1b3e into master Oct 6, 2016
@whyrusleeping whyrusleeping deleted the deps/libp2p-extravaganza branch October 6, 2016 05:52
@whyrusleeping whyrusleeping removed the status/in-progress In progress label Oct 6, 2016
@ghost ghost mentioned this pull request Dec 23, 2016
hacdias pushed a commit to ipfs/boxo that referenced this pull request Jan 27, 2023
update to libp2p 4.0.1 and propogate other changes

This commit was moved from ipfs/kubo@67a1b3e
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.

1 participant