pallet_subtensor_swap::Pallet::adjust_protocol_liquidity (pallets/swap/src/pallet/impls.rs:84-117) calls Balancer::update_weights_for_added_liquidity to recompute the new quote_weight after a disproportional injection. If the computed weight would fall outside [MIN_WEIGHT, 1 - MIN_WEIGHT] = [0.01, 0.99], the call returns BalancerError::InvalidValue. In that case adjust_protocol_liquidity silently logs a warning and returns (TaoBalance::ZERO, AlphaBalance::ZERO):
if balancer
.update_weights_for_added_liquidity(...)
.is_err()
{
log::warn!("Reserves are out of range for emission: ...");
(TaoBalance::ZERO, AlphaBalance::ZERO)
} else {
SwapBalancer::<T>::insert(netuid, balancer);
(tao_delta, alpha_delta)
}
The fix is to either (a) fall back to a clamped weight (MIN_WEIGHT or 1 - MIN_WEIGHT) when the computed weight is out of range and still inject the deltas, (b) at minimum, surface a hard error / event so the coinbase can carry-over the emission to the next block instead of burning it, or (c) accumulate the injection in reserviors and settle later.
pallet_subtensor_swap::Pallet::adjust_protocol_liquidity(pallets/swap/src/pallet/impls.rs:84-117) callsBalancer::update_weights_for_added_liquidityto recompute the newquote_weightafter a disproportional injection. If the computed weight would fall outside[MIN_WEIGHT, 1 - MIN_WEIGHT] = [0.01, 0.99], the call returnsBalancerError::InvalidValue. In that caseadjust_protocol_liquiditysilently logs a warning and returns(TaoBalance::ZERO, AlphaBalance::ZERO):The fix is to either (a) fall back to a clamped weight (
MIN_WEIGHTor1 - MIN_WEIGHT) when the computed weight is out of range and still inject the deltas, (b) at minimum, surface a hard error / event so the coinbase can carry-over the emission to the next block instead of burning it, or (c) accumulate the injection in reserviors and settle later.