centrifuge / fudge

FUlly Decoupled Generic Environment for Substrate-chains
Other
22 stars 2 forks source link

Build relay-chain block with correct `ParachainInherents` #13

Closed mustermeiszer closed 1 year ago

mustermeiszer commented 2 years ago

Currently we build the relay-chain block with the inherent like

 ParachainsInherentData::<HDR> {
    bitfields: vec![],
    backed_candidates: vec![],
    disputes: vec![],
    parent_header: self.parent_head.clone(),
};

Without manually mutating the state of the relay-chain after the next block has been build and injecting the new parachain heads there, the above inherent means, no parachain can make progress.

Actually generating this data "correctly" is essential to providing easy xcm support with a bigger hack.

There are two steps for this feature should be implemented in

Force Enact

The runtime-api of the parachain provides a method force_enact that allows to enact a parachain block. Usually this is only used with a state of a relay-chain that is afterwards not applied to the db. But we could hack this and use it in order to actually enact parachain-blocks after we have build the latest relay-chain-block.

Requires:

Tasks

mustermeiszer commented 1 year ago

Done in https://github.com/centrifuge/fudge/commit/ad4cf5e472530048941670d1268fa70b55f39604