-
Notifications
You must be signed in to change notification settings - Fork 665
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
Switch node side to v2 candidate receipts #5679
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
…ode_v2_descriptors
Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
…aritytech/polkadot-sdk into sandreim/node_v2_descriptors
Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
…aritytech/polkadot-sdk into sandreim/node_v2_descriptors Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
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.
Man was this a tough one to review 😄
Thanks for pushing through the tedious work!
Why is this stacked on top of #5423?
From a quick look it could be merged independently
pub collator_id: CollatorId, | ||
/// This will be missing when we create the struct from | ||
/// a v2 candidate receipt. instance | ||
pub collator_id: Option<CollatorId>, |
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.
FetchedCollation
is used as a key in a HashMap (fetched_candidates
). I think we still need some collator identifier here to differentiate between two collators advertising the same collation.
Since this is a fetched collation, we should have access to the collator id which is declared in CollatorProtocolMessage::Declare
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.
Took me a while to remember why I did this.
The gist of it is that for v2 descriptors, you cannot have the same candidate with different candidate hash, because there is no collator id and singature fields. This mapping is currently needed only for reputation changes and sending a Seconded message back to the collator that provided the collation. In slot based collator and even look ahead we don't make use of the seconded message AFAIK, and the reputation system just doesn't make much sense given that currently there is no way to really punish them.
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.
a | ||
} | ||
|
||
impl<H: Copy> From<CandidateDescriptor<H>> for CandidateDescriptorV2<H> { |
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's the difference between this and the previous implementation?
is it just for performance?
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, initially for testing it was good with encode/decode. At this point I am not sure if it is faster, but in theory should be.
@@ -368,7 +471,7 @@ pub enum CandidateReceiptError { | |||
|
|||
macro_rules! impl_getter { | |||
($field:ident, $type:ident) => { | |||
/// Returns the value of $field field. | |||
/// Returns the value of `$field`` field. |
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.
/// Returns the value of `$field`` field. | |
/// Returns the value of `$field` field. |
fn set_para_head(&mut self, para_head: Hash); | ||
} | ||
|
||
#[cfg(feature = "test")] |
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'd rather directly add these methods onto the CandidateDescriptorV2
and guard each of them with #[cfg(test)], which would save us the import of MutateDescriptorV2
. But fine either way really
@@ -451,7 +451,16 @@ pub fn backing_state<T: initializer::Config>( | |||
// | |||
// Thus, minimum relay parent is ensured to have asynchronous backing enabled. | |||
let now = frame_system::Pallet::<T>::block_number(); | |||
let min_relay_parent_number = shared::AllowedRelayParents::<T>::get() | |||
|
|||
// Workaround for issue #64. |
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 you meant to add this to #5423
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.
Yeah, and this explains why I messed up in #5423 (comment)
- audience: Node Dev | ||
description: | | ||
This change is just plumbing work and updates all crate interfaces to use the new primitives. | ||
Id doesn't alter any functionality and is required before implementing RFC103 on the |
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.
Id doesn't alter any functionality and is required before implementing RFC103 on the | |
It doesn't alter any functionality and is required before implementing RFC103 on the |
- name: cumulus-client-consensus-common | ||
bump: major | ||
- name: cumulus-client-pov-recovery | ||
bump: major |
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.
why are these two major? I think they should be none
actually, why is everything a major bump? :D
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've switched the subsystem messages and cumulus traits to new primtives so this breaks things.
Also I'm missing many crates here and the check fails.
on top of #5423
This PR implements the plumbing work required for #5047 . I also added additional helper methods gated by feature "test" in primitives.
TODO: