Skip to content

Commit

Permalink
add comment to explain why it's needed
Browse files Browse the repository at this point in the history
  • Loading branch information
librelois committed Jan 4, 2024
1 parent 435d0cf commit d27b13e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pallets/author-inherent/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@ pub mod pallet {
T::DbWeight::get().reads_writes(1, 2)
}
fn on_finalize(_: BlockNumberFor<T>) {
// According to parity, the only wayt to ensure that a mandatory inherent is included
// is by checking on block finaliztion that the inherent set a particular storage item:
// https://github.com/paritytech/polkadot-sdk/issues/2841#issuecomment-1876040854
assert!(
InherentIncluded::<T>::get() == true,
"Block invalid, missing inherent `kick_off_authorship_validation`"
Expand Down

0 comments on commit d27b13e

Please sign in to comment.