-
Notifications
You must be signed in to change notification settings - Fork 930
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
Gossipsub message signing #1583
Merged
Merged
Changes from 12 commits
Commits
Show all changes
43 commits
Select commit
Hold shift + click to select a range
aeba523
Gossipsub message signing
AgeManning 573e4b6
Update ipfs-private example
AgeManning d2babd4
Add optimisation to prevent key calculation each message
AgeManning ac3c977
Handle forwarding of signed messages and reviewers comments
AgeManning e9afd95
Merge branch 'master' into gossipsub-signing
AgeManning 3d1a025
protocols/gossipsub/src/protocol: Use quickcheck to test signing (#31)
mxinden 31b6849
Shift signing into behaviour
AgeManning a8cec0b
Merge latest master
AgeManning 2b38112
Address reviewers suggestions
AgeManning 7d678f5
Send subscriptions to all peers
AgeManning dc050dd
Update examples
AgeManning 5bf1cfc
Shift signing option into the behaviour
AgeManning 4ffe728
Revert changes to core/
AgeManning 24b738c
Reviewers suggestion
AgeManning a2e4bf0
Merge remote-tracking branch 'origin/master' into gossipsub-signing
AgeManning 2f20571
Merge latest master
AgeManning 2c50ba2
Revert changes to core/
AgeManning 4de878e
Switch gossipsub state to use sets instead of vectors
rklaehn e43f0a0
Make tests pass
rklaehn 57f07aa
Some clippy
rklaehn b6eeb3c
Prevent duplicate finding during JOIN
AgeManning 0d5bde4
Merge #1675
AgeManning aec51e0
Update tests, improve logging
AgeManning 759a5ad
Update the default d_lo constant
AgeManning 495ffe4
Handle errors correctly
AgeManning 1ea2dd9
Add privacy and validation options in the config
AgeManning 1f73ded
A few improvements (#32)
rklaehn 7b76c8f
Improve signing validation logic
AgeManning f5d32b2
Change the gossipsub rpc protocol to use bytes for message ids (#34)
rklaehn c3a7757
Add optional privacy and validation settings
AgeManning 0c43ed4
Correct doc link
AgeManning efa40e3
Prevent invalid messages from being gossiped
AgeManning a514c60
Remove unvalidated messages from gossip. Reintroduce duplicate cache
AgeManning b257025
Send grafts when subscriptions are added to the mesh
AgeManning b20771b
Merge latest master
AgeManning 2f4a50a
Only add messages to memcache if not duplicates
AgeManning be7c9e2
Add mesh maintenance tests and remove excess peers from mesh
AgeManning e049ff7
Apply reviewers suggestions
AgeManning 74d2779
Merge latest master
AgeManning 6bac865
Wrap comments
AgeManning 94469cf
Ensure sequence number is sent
AgeManning 60f8a1e
Merge latest master
AgeManning fef66dd
Maintain the debug trait
AgeManning File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,16 +27,22 @@ use std::fmt; | |
#[derive(Debug)] | ||
pub struct DecodingError { | ||
msg: String, | ||
source: Option<Box<dyn Error + Send + Sync>> | ||
source: Option<Box<dyn Error + Send + Sync>>, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @AgeManning can you revert these formatting changes as well? |
||
} | ||
|
||
impl DecodingError { | ||
pub(crate) fn new<S: ToString>(msg: S) -> Self { | ||
Self { msg: msg.to_string(), source: None } | ||
Self { | ||
msg: msg.to_string(), | ||
source: None, | ||
} | ||
} | ||
|
||
pub(crate) fn source(self, source: impl Error + Send + Sync + 'static) -> Self { | ||
Self { source: Some(Box::new(source)), .. self } | ||
Self { | ||
source: Some(Box::new(source)), | ||
..self | ||
} | ||
} | ||
} | ||
|
||
|
@@ -56,17 +62,23 @@ impl Error for DecodingError { | |
#[derive(Debug)] | ||
pub struct SigningError { | ||
msg: String, | ||
source: Option<Box<dyn Error + Send + Sync>> | ||
source: Option<Box<dyn Error + Send + Sync>>, | ||
} | ||
|
||
/// An error during encoding of key material. | ||
impl SigningError { | ||
pub(crate) fn new<S: ToString>(msg: S) -> Self { | ||
Self { msg: msg.to_string(), source: None } | ||
Self { | ||
msg: msg.to_string(), | ||
source: None, | ||
} | ||
} | ||
|
||
pub(crate) fn source(self, source: impl Error + Send + Sync + 'static) -> Self { | ||
Self { source: Some(Box::new(source)), .. self } | ||
Self { | ||
source: Some(Box::new(source)), | ||
..self | ||
} | ||
} | ||
} | ||
|
||
|
@@ -81,4 +93,3 @@ impl Error for SigningError { | |
self.source.as_ref().map(|s| &**s as &dyn Error) | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 am guessing that the changes in
identity.rs
andcore/src/identity/error.rs
were done by rustfmt. Would you mind reverting them in this pull-request as they seem unrelated? If you feel like the suggestions would improve code readability please open a separate pull request.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.
Yep, editor has it in by default. I usually catch these, seems I missed one.