-
Notifications
You must be signed in to change notification settings - Fork 12
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
Implement SSV Handshake Protocol #125
Conversation
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.
Hi Diego, thanks for starting this.
Left some comments
} | ||
|
||
/// Network behaviour handling the handshake protocol. | ||
pub struct HandshakeBehaviour { |
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.
skimming through the NetworkBehaviour
implementation, and without knowing much about the requirements I wonder if we can suffice our needs by just implementing the Codec
trait and not needing to have request-response
as a sub behaviour
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 would this approach look like?
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.
using the request-response
Behaviour
and then doing the validation envelope signing validation logic in the Codec
implementation.
Does that make sense Diego?
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.
Yes, having the validation in the codec is the way to go. About only one behavior, I'll need to think more about 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.
I think it's nice to keep the behavior and centralize everything related to the handshake there, exposing only the events to the main behavior.
fdd1b40
to
949101a
Compare
# Conflicts: # Cargo.lock # anchor/network/Cargo.toml
2d73969
to
6ed5a32
Compare
6ed5a32
to
495b2ea
Compare
67c7cab
to
7f74282
Compare
7f74282
to
266c4e5
Compare
eacbd88
to
b6666c7
Compare
cdb441b
to
dcf9727
Compare
Hey @diegomrsantos, hey @jxs, thank you for your discussion in this PR. You are both making a good case for your proposed variants. To better visualise the changes proposed by João (as I understand them), I implemented them here based on this PR. To summarize the changes:
Overall, I think I personally prefer this approach. Please take a look at my changes. Of course, I am fine with iterating more on the design. Looking forward to your thoughts. |
0270621
to
7d3f32d
Compare
a452805
to
b155c64
Compare
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.
Thanks for implementing this, especially with the lack of a pre-existing spec! It's also great that we now have a spec.
We'll handle potential improvements separately.
Issue Addressed
Implements #116
Proposed Changes
Dependencies:
Handshake Protocol:
Network Behaviour:
Network Implementation:
Additional Info
There's a spec in README.md file