-
Notifications
You must be signed in to change notification settings - Fork 32
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
[Libp2p] - Refactor VID Delayed Requester To Use Message Passing #3688
Conversation
Ok(serialized) => serialized, | ||
Err(e) => { | ||
tracing::error!("Failed to serialize outgoing message: this should never happen. Error: {e}"); | ||
match receiver.recv_direct().await { |
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
.await; | ||
} | ||
} | ||
SequencingMessage::General(_) => {} |
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 this also include responses for proposal? Or is that handled by a different message type?
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.
we have those GeneralConsensusMessage
. Im not sure how easy it would be to refactor them into here. I need to think a little more on this
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.
If we want to move them we can probably make a separate issue
c41de18
to
4b59c24
Compare
Closes #3617 and #3599
This PR:
Implements the HotShotEvent Request / Response framework for VID shares. We recently did this to retrieve QCs and now we are making it a standard. In the Request and Response task we now emit/receive new
HotShotEvent
s, those being:VidRequestSend
: This is when a node sends a request to the DA committee to retrieve a VID share for a specified view.VidRequestRecv
: This event is for members of the DA committee, they will receive the request and respond with the VID share for the view.VidResponseSend
: This event emits the VID share to the network task so we can send it back to the requesting node.VidResponseRecv
: The requesting node will wait in a background task for this response and then validate the VID share.Previously we used a separate channel to request / receive VID shares. We also cleanup the old logic in this PR.
Another thing we do is remove the loop where we iterate over all DA committee members for a given view
VidShareRecv
events to verify . We now add the sender public key and use that so no need to check every member.This PR does not:
Key places to review:
I do most of the refactoring in
request.rs
andresponse.rs
. I am also not using the other channel anymore and relying on the main network task to send these messages now.Also on HS Event
VidShareRecv
make sure the logic looks correct where I remove the loopHow to test this PR:
The
combined_network
tests will test this new logic