Skip to content

Commit eaff705

Browse files
authored
Merge pull request #566 from subspace/reject-incorrect-block-during-verification
Another workaround for Gemini 1b launch preventing import of bad blocks on verification
2 parents eaa4aeb + 0402332 commit eaff705

File tree

1 file changed

+15
-0
lines changed
  • crates/sc-consensus-subspace/src

1 file changed

+15
-0
lines changed

crates/sc-consensus-subspace/src/lib.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -802,6 +802,21 @@ where
802802
.ok_or(Error::<Block::Header>::MissingSalt(hash))?
803803
.salt;
804804

805+
// TODO: Hack for Gemini 1b launch. Solution range should have been updated already.
806+
if *block.header.number() >= 33_671_u32.into()
807+
&& self.client.info().genesis_hash.as_ref() == GEMINI_1B_GENESIS_HASH
808+
&& solution_range == 12_009_599_006_321_322_u64
809+
{
810+
debug!(
811+
target: "subspace",
812+
"Ignoring block from non-canonical fork"
813+
);
814+
return Err(Error::<Block::Header>::InvalidSolutionRange(
815+
block.post_hash.unwrap_or_default(),
816+
)
817+
.into());
818+
}
819+
805820
// We add one to the current slot to allow for some small drift.
806821
// FIXME https://github.com/paritytech/substrate/issues/1019 in the future, alter this
807822
// queue to allow deferring of headers

0 commit comments

Comments
 (0)