-
Notifications
You must be signed in to change notification settings - Fork 823
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
feat(collator) add export pov on slot base collator #7585
base: master
Are you sure you want to change the base?
Conversation
@@ -140,6 +146,28 @@ async fn handle_collation_message<Block: BlockT>( | |||
); | |||
|
|||
if let MaybeCompressedPoV::Compressed(ref pov) = collation.proof_of_validity { | |||
|
|||
if let Ok(relay_parent_header) = relay_client.header(BlockId::Hash(relay_parent)).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.
Please adjust this a bit:
- You can pattern match directly for
Ok(Some(relay_parent_header))
- Check for
export_pov
as outermost check, otherwise we always fetch therelay_parent_header
here even though we don't need to (most of the time,export_pov
will be false, it is rarely used).
@@ -74,7 +74,7 @@ use crate::{collator as collator_util, LOG_TARGET}; | |||
/// | |||
/// The `parent_header`, `relay_parent_storage_root` and `relay_parent_number` will also be | |||
/// stored in the file alongside the `pov`. This enables stateless validation of the `pov`. | |||
fn export_pov_to_path<Block: BlockT>( | |||
pub fn export_pov_to_path<Block: BlockT>( |
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.
Please just move the method to the lib.rs
of this crate.
@@ -68,6 +71,7 @@ pub async fn run_collation_task<Block, RClient, CS>( | |||
mut collator_receiver, | |||
mut block_import_handle, | |||
}: Params<Block, RClient, CS>, | |||
export_pov: Option<PathBuf> |
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.
Please make eport_pov
part of Params
|
||
let collation_task_fut = run_collation_task::<Block, _, _>(collator_task_params); | ||
// check here for export | ||
|
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.
let collation_task_fut = run_collation_task::<Block, _, _>(collator_task_params); | |
// check here for export |
/// | ||
/// The `parent_header`, `relay_parent_storage_root` and `relay_parent_number` will also be | ||
/// stored in the file alongside the `pov`. This enables stateless validation of the `pov`. | ||
pub fn export_pov_to_path<Block: BlockT>( |
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.
pub fn export_pov_to_path<Block: BlockT>( | |
pub(crate) fn export_pov_to_path<Block: BlockT>( |
slot_based::run::<Block, AuthorityPair, _, _, _, _, _, _, _, _, _>(params); | ||
let params_with_export = SlotBasedParamsWithExport { | ||
params, | ||
None |
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.
This does not compile because you need to provide a name for this struct field. But check the other comment, this should just be Params
.
- name: cumulus-test-service | ||
bump: patch | ||
- name: cumulus-client-consensus-aura | ||
bump: patch |
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.
Chaging the parameters is a major change, since the params are public.
bump: patch | |
bump: major |
title: 'Add export PoV on slot base collator' | ||
doc: | ||
- audience: [Node Dev, Node Operator] | ||
description: Add functionality to export Proof of Validity (PoV) based on collator slots. |
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.
description: Add functionality to export Proof of Validity (PoV) based on collator slots. | |
description: Add functionality to export the Proof of Validity (PoV) when the slot-based collator is used. |
Closes #7573
@skunert @bkchr