Skip to content

Commit

Permalink
Merge pull request #2767 from subspace/support-lack-of-parent-weight-…
Browse files Browse the repository at this point in the history
…info

Support lack of parent block weight
  • Loading branch information
nazar-pc authored May 21, 2024
2 parents 08cee62 + 5e06308 commit 37be0c9
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions crates/sc-consensus-subspace/src/block_import.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,6 @@ pub enum Error<Header: HeaderT> {
/// Piece verification failed
#[error("Piece verification failed for slot {0}")]
InvalidPiece(Slot),
/// Parent block has no associated weight
#[error("Parent block of {0} has no associated weight")]
ParentBlockNoAssociatedWeight(Header::Hash),
/// Block has invalid associated solution range
#[error("Invalid solution range for block {0}")]
InvalidSolutionRange(Header::Hash),
Expand Down Expand Up @@ -659,7 +656,7 @@ where
0
} else {
aux_schema::load_block_weight(self.client.as_ref(), block.header.parent_hash())?
.ok_or_else(|| Error::ParentBlockNoAssociatedWeight(block_hash))?
.unwrap_or_default()
};

let added_weight = calculate_block_weight(subspace_digest_items.solution_range);
Expand Down

0 comments on commit 37be0c9

Please sign in to comment.