Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Don't err on deactivated leaf during valiation. #3708

Merged
merged 2 commits into from
Aug 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 15 additions & 7 deletions node/core/backing/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ pub enum Error {
#[error(transparent)]
ValidationFailed(#[from] ValidationFailed),
#[error(transparent)]
Mpsc(#[from] mpsc::SendError),
BackgroundValidationMpsc(#[from] mpsc::SendError),
#[error(transparent)]
UtilError(#[from] util::Error),
}
Expand Down Expand Up @@ -444,7 +444,7 @@ async fn validate_and_make_available(
tx_command
.send(ValidatedCandidateCommand::AttestNoPoV(candidate.hash()))
.await
.map_err(Error::Mpsc)?;
.map_err(Error::BackgroundValidationMpsc)?;
return Ok(())
},
Err(err) => return Err(err),
Expand Down Expand Up @@ -650,11 +650,19 @@ impl CandidateBackingJob {
// spawn background task.
let bg = async move {
if let Err(e) = validate_and_make_available(params).await {
tracing::error!(
target: LOG_TARGET,
"Failed to validate and make available: {:?}",
e
);
if let Error::BackgroundValidationMpsc(error) = e {
tracing::debug!(
target: LOG_TARGET,
?error,
"Mpsc background validation mpsc died during validation- leaf no longer active?"
);
} else {
tracing::error!(
target: LOG_TARGET,
"Failed to validate and make available: {:?}",
e
);
}
}
};
sender
Expand Down
17 changes: 8 additions & 9 deletions runtime/kusama/src/weights/pallet_vesting.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,24 +42,23 @@ use sp_std::marker::PhantomData;
/// Weight functions for `pallet_vesting`.
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> pallet_vesting::WeightInfo for WeightInfo<T> {
fn vest_locked(l: u32, s: u32, ) -> Weight {
fn vest_locked(l: u32, s: u32) -> Weight {
(93_789_000 as Weight)
// Standard Error: 70_000
.saturating_add((41_000 as Weight).saturating_mul(l as Weight))
// Standard Error: 182_000
.saturating_add((211_000 as Weight).saturating_mul(s as Weight))

.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
}
fn vest_unlocked(_l: u32, s: u32, ) -> Weight {
fn vest_unlocked(_l: u32, s: u32) -> Weight {
(90_737_000 as Weight)
// Standard Error: 0
.saturating_add((263_000 as Weight).saturating_mul(s as Weight))
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
}
fn vest_other_locked(l: u32, s: u32, ) -> Weight {
fn vest_other_locked(l: u32, s: u32) -> Weight {
(85_211_000 as Weight)
// Standard Error: 17_000
.saturating_add((153_000 as Weight).saturating_mul(l as Weight))
Expand All @@ -68,7 +67,7 @@ impl<T: frame_system::Config> pallet_vesting::WeightInfo for WeightInfo<T> {
.saturating_add(T::DbWeight::get().reads(3 as Weight))
.saturating_add(T::DbWeight::get().writes(3 as Weight))
}
fn vest_other_unlocked(l: u32, s: u32, ) -> Weight {
fn vest_other_unlocked(l: u32, s: u32) -> Weight {
(90_368_000 as Weight)
// Standard Error: 17_000
.saturating_add((31_000 as Weight).saturating_mul(l as Weight))
Expand All @@ -77,21 +76,21 @@ impl<T: frame_system::Config> pallet_vesting::WeightInfo for WeightInfo<T> {
.saturating_add(T::DbWeight::get().reads(3 as Weight))
.saturating_add(T::DbWeight::get().writes(3 as Weight))
}
fn vested_transfer(l: u32, _s: u32, ) -> Weight {
fn vested_transfer(l: u32, _s: u32) -> Weight {
(167_500_000 as Weight)
// Standard Error: 194_000
.saturating_add((255_000 as Weight).saturating_mul(l as Weight))
.saturating_add(T::DbWeight::get().reads(3 as Weight))
.saturating_add(T::DbWeight::get().writes(3 as Weight))
}
fn force_vested_transfer(l: u32, _s: u32, ) -> Weight {
fn force_vested_transfer(l: u32, _s: u32) -> Weight {
(174_000_000 as Weight)
// Standard Error: 70_000
.saturating_add((143_000 as Weight).saturating_mul(l as Weight))
.saturating_add(T::DbWeight::get().reads(4 as Weight))
.saturating_add(T::DbWeight::get().writes(4 as Weight))
}
fn not_unlocking_merge_schedules(l: u32, s: u32, ) -> Weight {
fn not_unlocking_merge_schedules(l: u32, s: u32) -> Weight {
(101_778_000 as Weight)
// Standard Error: 17_000
.saturating_add((194_000 as Weight).saturating_mul(l as Weight))
Expand All @@ -100,7 +99,7 @@ impl<T: frame_system::Config> pallet_vesting::WeightInfo for WeightInfo<T> {
.saturating_add(T::DbWeight::get().reads(3 as Weight))
.saturating_add(T::DbWeight::get().writes(3 as Weight))
}
fn unlocking_merge_schedules(l: u32, s: u32, ) -> Weight {
fn unlocking_merge_schedules(l: u32, s: u32) -> Weight {
(104_111_000 as Weight)
// Standard Error: 88_000
.saturating_add((276_000 as Weight).saturating_mul(l as Weight))
Expand Down
17 changes: 8 additions & 9 deletions runtime/polkadot/src/weights/pallet_vesting.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ use sp_std::marker::PhantomData;
/// Weight functions for `pallet_vesting`.
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> pallet_vesting::WeightInfo for WeightInfo<T> {
fn vest_locked(l: u32, s: u32, ) -> Weight {
fn vest_locked(l: u32, s: u32) -> Weight {
(93_789_000 as Weight)
// Standard Error: 70_000
.saturating_add((41_000 as Weight).saturating_mul(l as Weight))
Expand All @@ -51,14 +51,14 @@ impl<T: frame_system::Config> pallet_vesting::WeightInfo for WeightInfo<T> {
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
}
fn vest_unlocked(_l: u32, s: u32, ) -> Weight {
fn vest_unlocked(_l: u32, s: u32) -> Weight {
(90_737_000 as Weight)
// Standard Error: 0
.saturating_add((263_000 as Weight).saturating_mul(s as Weight))
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
}
fn vest_other_locked(l: u32, s: u32, ) -> Weight {
fn vest_other_locked(l: u32, s: u32) -> Weight {
(85_211_000 as Weight)
// Standard Error: 17_000
.saturating_add((153_000 as Weight).saturating_mul(l as Weight))
Expand All @@ -67,7 +67,7 @@ impl<T: frame_system::Config> pallet_vesting::WeightInfo for WeightInfo<T> {
.saturating_add(T::DbWeight::get().reads(3 as Weight))
.saturating_add(T::DbWeight::get().writes(3 as Weight))
}
fn vest_other_unlocked(l: u32, s: u32, ) -> Weight {
fn vest_other_unlocked(l: u32, s: u32) -> Weight {
(90_368_000 as Weight)
// Standard Error: 17_000
.saturating_add((31_000 as Weight).saturating_mul(l as Weight))
Expand All @@ -76,21 +76,21 @@ impl<T: frame_system::Config> pallet_vesting::WeightInfo for WeightInfo<T> {
.saturating_add(T::DbWeight::get().reads(3 as Weight))
.saturating_add(T::DbWeight::get().writes(3 as Weight))
}
fn vested_transfer(l: u32, _s: u32, ) -> Weight {
fn vested_transfer(l: u32, _s: u32) -> Weight {
(167_500_000 as Weight)
// Standard Error: 194_000
.saturating_add((255_000 as Weight).saturating_mul(l as Weight))
.saturating_add(T::DbWeight::get().reads(3 as Weight))
.saturating_add(T::DbWeight::get().writes(3 as Weight))
}
fn force_vested_transfer(l: u32, _s: u32, ) -> Weight {
fn force_vested_transfer(l: u32, _s: u32) -> Weight {
(174_000_000 as Weight)
// Standard Error: 70_000
.saturating_add((143_000 as Weight).saturating_mul(l as Weight))
.saturating_add(T::DbWeight::get().reads(4 as Weight))
.saturating_add(T::DbWeight::get().writes(4 as Weight))
}
fn not_unlocking_merge_schedules(l: u32, s: u32, ) -> Weight {
fn not_unlocking_merge_schedules(l: u32, s: u32) -> Weight {
(101_778_000 as Weight)
// Standard Error: 17_000
.saturating_add((194_000 as Weight).saturating_mul(l as Weight))
Expand All @@ -99,7 +99,7 @@ impl<T: frame_system::Config> pallet_vesting::WeightInfo for WeightInfo<T> {
.saturating_add(T::DbWeight::get().reads(3 as Weight))
.saturating_add(T::DbWeight::get().writes(3 as Weight))
}
fn unlocking_merge_schedules(l: u32, s: u32, ) -> Weight {
fn unlocking_merge_schedules(l: u32, s: u32) -> Weight {
(104_111_000 as Weight)
// Standard Error: 88_000
.saturating_add((276_000 as Weight).saturating_mul(l as Weight))
Expand All @@ -109,4 +109,3 @@ impl<T: frame_system::Config> pallet_vesting::WeightInfo for WeightInfo<T> {
.saturating_add(T::DbWeight::get().writes(3 as Weight))
}
}

18 changes: 9 additions & 9 deletions runtime/westend/src/weights/pallet_vesting.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ use sp_std::marker::PhantomData;
/// Weight functions for `pallet_vesting`.
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> pallet_vesting::WeightInfo for WeightInfo<T> {
fn vest_locked(l: u32, s: u32, ) -> Weight {
fn vest_locked(l: u32, s: u32) -> Weight {
(93_789_000 as Weight)
// Standard Error: 70_000
.saturating_add((41_000 as Weight).saturating_mul(l as Weight))
Expand All @@ -51,14 +51,14 @@ impl<T: frame_system::Config> pallet_vesting::WeightInfo for WeightInfo<T> {
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
}
fn vest_unlocked(_l: u32, s: u32, ) -> Weight {
fn vest_unlocked(_l: u32, s: u32) -> Weight {
(90_737_000 as Weight)
// Standard Error: 0
.saturating_add((263_000 as Weight).saturating_mul(s as Weight))
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
}
fn vest_other_locked(l: u32, s: u32, ) -> Weight {
fn vest_other_locked(l: u32, s: u32) -> Weight {
(85_211_000 as Weight)
// Standard Error: 17_000
.saturating_add((153_000 as Weight).saturating_mul(l as Weight))
Expand All @@ -67,7 +67,7 @@ impl<T: frame_system::Config> pallet_vesting::WeightInfo for WeightInfo<T> {
.saturating_add(T::DbWeight::get().reads(3 as Weight))
.saturating_add(T::DbWeight::get().writes(3 as Weight))
}
fn vest_other_unlocked(l: u32, s: u32, ) -> Weight {
fn vest_other_unlocked(l: u32, s: u32) -> Weight {
(90_368_000 as Weight)
// Standard Error: 17_000
.saturating_add((31_000 as Weight).saturating_mul(l as Weight))
Expand All @@ -76,21 +76,21 @@ impl<T: frame_system::Config> pallet_vesting::WeightInfo for WeightInfo<T> {
.saturating_add(T::DbWeight::get().reads(3 as Weight))
.saturating_add(T::DbWeight::get().writes(3 as Weight))
}
fn vested_transfer(l: u32, _s: u32, ) -> Weight {
fn vested_transfer(l: u32, _s: u32) -> Weight {
(167_500_000 as Weight)
// Standard Error: 194_000
.saturating_add((255_000 as Weight).saturating_mul(l as Weight))
.saturating_add(T::DbWeight::get().reads(3 as Weight))
.saturating_add(T::DbWeight::get().writes(3 as Weight))
}
fn force_vested_transfer(l: u32, _s: u32, ) -> Weight {
fn force_vested_transfer(l: u32, _s: u32) -> Weight {
(174_000_000 as Weight)
// Standard Error: 70_000
.saturating_add((143_000 as Weight).saturating_mul(l as Weight))
.saturating_add(T::DbWeight::get().reads(4 as Weight))
.saturating_add(T::DbWeight::get().writes(4 as Weight))
}
fn not_unlocking_merge_schedules(l: u32, s: u32, ) -> Weight {
fn not_unlocking_merge_schedules(l: u32, s: u32) -> Weight {
(101_778_000 as Weight)
// Standard Error: 17_000
.saturating_add((194_000 as Weight).saturating_mul(l as Weight))
Expand All @@ -99,7 +99,7 @@ impl<T: frame_system::Config> pallet_vesting::WeightInfo for WeightInfo<T> {
.saturating_add(T::DbWeight::get().reads(3 as Weight))
.saturating_add(T::DbWeight::get().writes(3 as Weight))
}
fn unlocking_merge_schedules(l: u32, s: u32, ) -> Weight {
fn unlocking_merge_schedules(l: u32, s: u32) -> Weight {
(104_111_000 as Weight)
// Standard Error: 88_000
.saturating_add((276_000 as Weight).saturating_mul(l as Weight))
Expand All @@ -108,4 +108,4 @@ impl<T: frame_system::Config> pallet_vesting::WeightInfo for WeightInfo<T> {
.saturating_add(T::DbWeight::get().reads(3 as Weight))
.saturating_add(T::DbWeight::get().writes(3 as Weight))
}
}
}