pub trait ConsensusHook {
// Required method
fn on_state_proof(
state_proof: &RelayChainStateProof
) -> (Weight, UnincludedSegmentCapacity);
}
Expand description
The consensus hook for dealing with the unincluded segment.
Higher-level and user-configurable consensus logic is more informed about the desired unincluded segment length, as well as any rules for adapting it dynamically according to the relay-chain state.
Required Methods§
sourcefn on_state_proof(
state_proof: &RelayChainStateProof
) -> (Weight, UnincludedSegmentCapacity)
fn on_state_proof( state_proof: &RelayChainStateProof ) -> (Weight, UnincludedSegmentCapacity)
This hook is called partway through the set_validation_data
inherent in parachain-system.
The hook is allowed to panic if customized consensus rules aren’t met and is required to return a maximum capacity for the unincluded segment with weight consumed.