Skip to content

Commit

Permalink
Merge pull request #2709 from subspace/domain_fixes
Browse files Browse the repository at this point in the history
update domain block builder to use hack introduced in #2700
  • Loading branch information
vedhavyas authored Apr 23, 2024
2 parents 9f4801a + 42b6d92 commit 17273ee
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion domains/client/block-builder/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,20 @@ where
api.record_proof();
}

api.initialize_block(parent_hash, &header)?;
let core_version = api
.api_version::<dyn Core<Block>>(parent_hash)?
.ok_or_else(|| Error::VersionInvalid("Core".to_string()))?;

if core_version >= 5 {
if api.initialize_block(parent_hash, &header).is_err() {
// TODO: Hack for Subspace fork caused by
// https://github.com/subspace/polkadot-sdk/commit/447bbc765020674614e9ac982163f7e11e5b03ea
// Replace with error propagation before next network
}
} else {
#[allow(deprecated)]
api.initialize_block_before_version_5(parent_hash, &header)?;
}

if let Some(inherent_data) = maybe_inherent_data {
let inherent_extrinsics = Self::create_inherents(parent_hash, &api, inherent_data)?;
Expand Down

0 comments on commit 17273ee

Please sign in to comment.