Skip to content

Commit

Permalink
Merge pull request #566 from subspace/reject-incorrect-block-during-v…
Browse files Browse the repository at this point in the history
…erification

Another workaround for Gemini 1b launch preventing import of bad blocks on verification
  • Loading branch information
nazar-pc authored Jun 8, 2022
2 parents eaa4aeb + 0402332 commit eaff705
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions crates/sc-consensus-subspace/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -802,6 +802,21 @@ where
.ok_or(Error::<Block::Header>::MissingSalt(hash))?
.salt;

// TODO: Hack for Gemini 1b launch. Solution range should have been updated already.
if *block.header.number() >= 33_671_u32.into()
&& self.client.info().genesis_hash.as_ref() == GEMINI_1B_GENESIS_HASH
&& solution_range == 12_009_599_006_321_322_u64
{
debug!(
target: "subspace",
"Ignoring block from non-canonical fork"
);
return Err(Error::<Block::Header>::InvalidSolutionRange(
block.post_hash.unwrap_or_default(),
)
.into());
}

// We add one to the current slot to allow for some small drift.
// FIXME https://github.com/paritytech/substrate/issues/1019 in the future, alter this
// queue to allow deferring of headers
Expand Down

0 comments on commit eaff705

Please sign in to comment.