-
-
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 ipns validator #4597
Update ipns validator #4597
Conversation
License: MIT Signed-off-by: Dirk McCormick <[email protected]>
namesys/publisher.go
Outdated
// need to do that here | ||
|
||
// Author in key must match author in record | ||
parts := strings.Split(r.Key, "/") |
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.
do we need this split?
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.
You're right the relative path component of the IPNS path is not stored in the DHT (only in DNS)
License: MIT Signed-off-by: Dirk McCormick <[email protected]>
You need to add the new dependencies to package.json using |
you also need to |
License: MIT Signed-off-by: Dirk McCormick <[email protected]>
I wanted to ask you guys about the dependencies. I used Is there some easy way of doing all this package management stuff so it will figure out what needs to be updated and do it one step? |
Sounds like some dependency will need to propagage -- @Stebalien usually handles those. |
License: MIT Signed-off-by: Dirk McCormick <[email protected]>
We need to at some point write a guide for "propogating gx dependencies" |
The gold standard is whether a recovering java dev can understand 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.
LGTM. We'll have to hold for the cmds merge.
if err != nil { | ||
return ErrInvalidAuthor | ||
} | ||
if string(pid) != string(r.Author) { |
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.
Do we actually need to call string
here?
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.
No, we should be able to get rid of that cast once the go-libp2p-peer lib is updated
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.
Once the cmds merge is complete I will update the deps and test manually |
So, unfortunately, this actually breaks things (the republisher test cases) because we allow publishing IPNS records using one key and then signing the DHT record with another. For example, when publishing an IPNS record with an alternative key, we sign it with the alternative key and then sign the DHT record with the peer key. The correct solution here is to:
Unfortunately, validating the IPNS signature in the validator is a bit tricky... so I'm not going to fix that in my existing pr (#4610). |
That makes sense, if there's a peer ID in the key there's no need to replicate it in the DHT record. |
No, we'll probably construct the IPNS validator as a closure and have it capture the peerstore (so it can extract the keys from that). Ideally, the validator would take some additional "validation" information but we'll probably need to wait for a general-purpose IPRS for that. |
Makes sense. Should we close this PR now that it's superseded by #4613? |
Yes. |
Update go-ipfs to use new validation function format in go-libp2p-record
#4566 was getting messy so I closed and opened this new PR