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

Commit 0100b3b

Browse files
authored
sc-finality-grandpa: Warp proof generation can not expect justifications (#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.
1 parent ece32a7 commit 0100b3b

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

client/cli/src/params/pruning_params.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ pub struct PruningParams {
4949
/// [default: 256]
5050
#[arg(alias = "pruning", long, value_name = "PRUNING_MODE")]
5151
pub state_pruning: Option<DatabasePruningMode>,
52+
5253
/// Specify the blocks pruning mode.
5354
///
5455
/// This mode specifies when the block's body (including justifications)

client/finality-grandpa/src/warp_proof.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -135,11 +135,7 @@ impl<Block: BlockT> WarpSyncProof<Block> {
135135
let justification = blockchain
136136
.justifications(header.hash())?
137137
.and_then(|just| just.into_justification(GRANDPA_ENGINE_ID))
138-
.expect(
139-
"header is last in set and contains standard change signal; \
140-
must have justification; \
141-
qed.",
142-
);
138+
.ok_or_else(|| Error::MissingData)?;
143139

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

0 commit comments

Comments
 (0)