Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
sc-finality-grandpa: Warp proof generation can not expect justificati…
Browse files Browse the repository at this point in the history
…ons (#13249)

When a node is running with `--blocks-pruning` it will also prunes justifications. So, the warp
proof generation can not use `expect` for unwrapping the justification.
  • Loading branch information
bkchr authored and Ank4n committed Feb 28, 2023
1 parent ece32a7 commit 775f34e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
1 change: 1 addition & 0 deletions client/cli/src/params/pruning_params.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ pub struct PruningParams {
/// [default: 256]
#[arg(alias = "pruning", long, value_name = "PRUNING_MODE")]
pub state_pruning: Option<DatabasePruningMode>,

/// Specify the blocks pruning mode.
///
/// This mode specifies when the block's body (including justifications)
Expand Down
6 changes: 1 addition & 5 deletions client/finality-grandpa/src/warp_proof.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,7 @@ impl<Block: BlockT> WarpSyncProof<Block> {
let justification = blockchain
.justifications(header.hash())?
.and_then(|just| just.into_justification(GRANDPA_ENGINE_ID))
.expect(
"header is last in set and contains standard change signal; \
must have justification; \
qed.",
);
.ok_or_else(|| Error::MissingData)?;

let justification = GrandpaJustification::<Block>::decode(&mut &justification[..])?;

Expand Down

0 comments on commit 775f34e

Please sign in to comment.