From d30f93ab5d0ab510a2fdab0b1c80bffe10d36429 Mon Sep 17 00:00:00 2001 From: Ankan Date: Fri, 3 Nov 2023 21:24:15 +0100 Subject: [PATCH] convert to warn as this is possible when there is a slashing event --- substrate/frame/staking/src/pallet/impls.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/substrate/frame/staking/src/pallet/impls.rs b/substrate/frame/staking/src/pallet/impls.rs index b610df70e582..4780bef2db02 100644 --- a/substrate/frame/staking/src/pallet/impls.rs +++ b/substrate/frame/staking/src/pallet/impls.rs @@ -1903,12 +1903,12 @@ impl Pallet { }) .collect::, _>>()?; - // we take total instead of active as the nominator might have requested to unbond + // We take total instead of active as the nominator might have requested to unbond // some of their stake that is still exposed in the current era. - ensure!( - sum <= Self::ledger(StakingAccount::Stash(nominator.clone()))?.total, - "nominator stake exceeds what is bonded." - ); + // This can happen when there is a slash in the current era so we only warn. + if sum <= Self::ledger(Stash(nominator.clone()))?.total { + log!(warn, "nominator stake exceeds what is bonded."); + } Ok(()) })