Skip to content
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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

MrishoLukamba
Copy link
Contributor

@MrishoLukamba MrishoLukamba commented Feb 16, 2025

@@ -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 {
Copy link
Contributor

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 the relay_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>(
Copy link
Member

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.

@MrishoLukamba
Copy link
Contributor Author

Done, all the failing checks arent related to PR @skunert @bkchr except the fmt

@@ -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>
Copy link
Contributor

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

Comment on lines 175 to +177

let collation_task_fut = run_collation_task::<Block, _, _>(collator_task_params);
// check here for export

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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>(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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
Copy link
Contributor

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
Copy link
Contributor

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.

Suggested change
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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add pov-export to slot-based collator
3 participants