Commit eeb79ab7 authored by Peter Goodspeed-Niklaus's avatar Peter Goodspeed-Niklaus
Browse files

BROKEN: add note if the current block matches the session start block

This doesn't compile for a variety of reasons; this commit demonstrates
what the issues are. I don't think this is an essential feature, so I'm
stopping work on it here instead of pushing through it.
parent 6e5bb037
...@@ -34,7 +34,7 @@ use frame_support::{ ...@@ -34,7 +34,7 @@ use frame_support::{
use frame_system::ensure_none; use frame_system::ensure_none;
use crate::{ use crate::{
inclusion, inclusion,
scheduler::{self, FreedReason}, scheduler::{self, FreedReason, SessionStartBlock},
ump, ump,
}; };
use inherents::{InherentIdentifier, InherentData, MakeFatalError, ProvideInherent}; use inherents::{InherentIdentifier, InherentData, MakeFatalError, ProvideInherent};
...@@ -176,7 +176,7 @@ fn limit_backed_candidates<T: Config>( ...@@ -176,7 +176,7 @@ fn limit_backed_candidates<T: Config>(
} }
} }
impl<T: Config> ProvideInherent for Module<T> { impl<T: Config + frame_system::Config<BlockNumber = T>> ProvideInherent for Module<T> {
type Call = Call<T>; type Call = Call<T>;
type Error = MakeFatalError<()>; type Error = MakeFatalError<()>;
const INHERENT_IDENTIFIER: InherentIdentifier = INCLUSION_INHERENT_IDENTIFIER; const INHERENT_IDENTIFIER: InherentIdentifier = INCLUSION_INHERENT_IDENTIFIER;
...@@ -206,6 +206,13 @@ impl<T: Config> ProvideInherent for Module<T> { ...@@ -206,6 +206,13 @@ impl<T: Config> ProvideInherent for Module<T> {
an invalid inclusion inherent: {:?}", an invalid inclusion inherent: {:?}",
err, err,
); );
if SessionStartBlock::get() == <frame_system::Module<T>>::block_number() {
frame_support::debug::info!(
target: "runtime_inclusion_inherent",
"this is the first block of the session, so dropping the signed bitfields and \
backed candidates is not unexpected",
);
}
(Vec::new().into(), Vec::new()) (Vec::new().into(), Vec::new())
} }
}; };
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment