mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 03:31:05 +00:00
Don't log so many stkaing events on genesis block (#8339)
* Don't log so many stkaing events on genesis block * Clean a few more warn and info logs * Update frame/staking/src/lib.rs * Update frame/staking/src/lib.rs
This commit is contained in:
@@ -1019,12 +1019,16 @@ impl<T: Config> Pallet<T> {
|
|||||||
)
|
)
|
||||||
.map(|(supports, compute)| {
|
.map(|(supports, compute)| {
|
||||||
Self::deposit_event(Event::ElectionFinalized(Some(compute)));
|
Self::deposit_event(Event::ElectionFinalized(Some(compute)));
|
||||||
|
if Self::round() != 1 {
|
||||||
log!(info, "Finalized election round with compute {:?}.", compute);
|
log!(info, "Finalized election round with compute {:?}.", compute);
|
||||||
|
}
|
||||||
supports
|
supports
|
||||||
})
|
})
|
||||||
.map_err(|err| {
|
.map_err(|err| {
|
||||||
Self::deposit_event(Event::ElectionFinalized(None));
|
Self::deposit_event(Event::ElectionFinalized(None));
|
||||||
|
if Self::round() != 1 {
|
||||||
log!(warn, "Failed to finalize election round. reason {:?}", err);
|
log!(warn, "Failed to finalize election round. reason {:?}", err);
|
||||||
|
}
|
||||||
err
|
err
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2938,6 +2938,7 @@ impl<T: Config> Module<T> {
|
|||||||
// emit event
|
// emit event
|
||||||
Self::deposit_event(RawEvent::StakingElection(compute));
|
Self::deposit_event(RawEvent::StakingElection(compute));
|
||||||
|
|
||||||
|
if current_era > 0 {
|
||||||
log!(
|
log!(
|
||||||
info,
|
info,
|
||||||
"new validator set of size {:?} has been elected via {:?} for staring era {:?}",
|
"new validator set of size {:?} has been elected via {:?} for staring era {:?}",
|
||||||
@@ -2945,6 +2946,7 @@ impl<T: Config> Module<T> {
|
|||||||
compute,
|
compute,
|
||||||
current_era,
|
current_era,
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
Some(elected_stashes)
|
Some(elected_stashes)
|
||||||
} else {
|
} else {
|
||||||
@@ -3132,11 +3134,13 @@ impl<T: Config> Module<T> {
|
|||||||
let elected_stashes = exposures.iter().cloned().map(|(x, _)| x).collect::<Vec<_>>();
|
let elected_stashes = exposures.iter().cloned().map(|(x, _)| x).collect::<Vec<_>>();
|
||||||
|
|
||||||
if (elected_stashes.len() as u32) <= Self::minimum_validator_count() {
|
if (elected_stashes.len() as u32) <= Self::minimum_validator_count() {
|
||||||
|
if current_era > 0 {
|
||||||
log!(
|
log!(
|
||||||
warn,
|
warn,
|
||||||
"chain does not have enough staking candidates to operate for era {:?}",
|
"chain does not have enough staking candidates to operate for era {:?}",
|
||||||
current_era,
|
current_era,
|
||||||
);
|
);
|
||||||
|
}
|
||||||
return Err(());
|
return Err(());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user