Skip to content

Commit

Permalink
sc-finality-grandpa: Warp proof generation can not expect justificati…
Browse files Browse the repository at this point in the history
…ons (paritytech#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 nathanwhit committed Jul 19, 2023
1 parent 14ad04b commit 92c643f
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 92c643f

Please sign in to comment.