-
Notifications
You must be signed in to change notification settings - Fork 1k
Send PeerId via UMP #10145
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
base: master
Are you sure you want to change the base?
Send PeerId via UMP #10145
Conversation
f19389c to
97bebcf
Compare
97bebcf to
730dfc3
Compare
730dfc3 to
239752a
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 @serban300 . Looks good, left a few comments.
| /// This method expects to receive a `Vec` of at most 64 bytes. Otherwise, it panics. | ||
| pub fn unchecked_new_approved_peer_id(bytes: Vec<u8>) -> ApprovedPeerId { | ||
| ApprovedPeerId::try_from(bytes) | ||
| .expect("unchecked_new_approved_peer_id() should receive a sequence of at most 64 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.
Not really nice this panics. Maybe Option better ?
| relay_chain_state, | ||
| relay_parent_descendants, | ||
| collator_peer_id: None, | ||
| collator_peer_id: Some(collator_peer_id), |
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 this is the only place where we should convert using unchecked_new_approved_peer_id, and keep using the client network primitive PeerId across the node.
| CumulusDigestItem::find_core_info(&frame_system::Pallet::<T>::digest()) | ||
| { | ||
| ump_signals.push( | ||
| UMPSignal::SelectCore(core_info.selector, core_info.claim_queue_offset).encode(), |
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 should double check before merging if UMPSignal::ApprovedPeer is supported by current RC runtimes.
| // Take the pending UMP signals. | ||
| let mut ump_signals = PendingUpwardSignals::<T>::take(); | ||
| // Append the core selector signal. | ||
| if let Some(core_info) = |
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.
Looks a bit inconsistent now that you added PendingUpwardSignals, why not put UMPSignal::SelectCore there as well ?
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
Resolves #7749