I am having trouble understanding the verification process for storage changes that are applied during the on_initialize
hooks of a pallet. From what I understand, imported blocks do not re-run any process that occurs in the hooks, so how do "importers" confirm that they accept the changes that are made outside of an extrinsic?
For instance, in Kulupu, the rewards are delegated through the on_finalize
process:
fn on_finalize(now: T::BlockNumber) {
if let Some(author) = <Self as Store>::Author::get() {
let reward = Reward::<T>::get();
Self::do_reward(&author, reward, now);
}
let mints = Mints::<T>::get();
Self::do_mints(&mints);
<Self as Store>::Author::kill();
}
fn do_mints(mints: &BTreeMap<T::AccountId, BalanceOf<T>>) {
for (destination, mint) in mints {
drop(T::Currency::deposit_creating(&destination, *mint));
}
}
I don't see anywhere in that codebase that's checking what rewards a given node gave to an author.