-
Notifications
You must be signed in to change notification settings - Fork 35
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
[2/n] Introduce node-protocol #1242
Conversation
97f4799
to
d4f7ea0
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.
Nice work @AhmedSoliman. I do understand now what you mean with directly reusing simple protobuf types. I think it makes sense how you used them to avoid adding more boilerplate. I also learned about prost_build::Config::enum_attribute
which is really cool :-)
+1 for merging this PR.
ebf8b81
to
22f97d2
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.
Great work @AhmedSoliman. +1 for merging.
|
||
anyhow = { workspace = true } | ||
arc-swap = { workspace = true } | ||
async-trait = { workspace = true } |
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 still need this dependency in this version?
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, that's used in a MessageRouter up in this stack of PRs.
/// If `to` is a NodeID with generation, then it's guaranteed that messages will be sent to | ||
/// this particular generation, otherwise, it'll be routed to the latest generation available | ||
/// in nodes configuration at the time of the call. This might return | ||
/// [[`NetworkSendError::OldPeerGeneration`]] if the node is is not the latest generation. |
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.
/// [[`NetworkSendError::OldPeerGeneration`]] if the node is is not the latest generation. | |
/// [[`NetworkSendError::OldPeerGeneration`]] if the node is not the latest generation. |
|
||
impl WireSerde for MetadataMessage { | ||
fn encode(&self, _protocol_version: ProtocolVersion) -> Result<Bytes, CodecError> { | ||
// serialize message to bytes |
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.
should we add an assert stating that _protocol_version
is actually BINCODE
?
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'm not sure this'd be particularly useful, but we can check if the version is "at least" BINCODE. I can add such check(s) in a future follow up as needed.
[2/n] Introduce node-protocol
Stack created with Sapling. Best reviewed with ReviewStack.