Skip to content
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
7 changes: 4 additions & 3 deletions pallets/parachain-staking/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ fn roll_to_and_author<T: Config>(round_delay: u32, author: T::AccountId) {
now += 1u32.into();
}
}

fn assert_last_event<T: Config>(generic_event: <T as Config>::RuntimeEvent) {
frame_system::Pallet::<T>::assert_last_event(generic_event.into());
}
Expand Down Expand Up @@ -782,6 +783,7 @@ benchmarks! {
);
}


cancel_delegator_bond_less {
let collator: T::AccountId = create_funded_collator::<T>(
"collator",
Expand Down Expand Up @@ -818,12 +820,11 @@ benchmarks! {
}

// ON_INITIALIZE

round_transition_on_initialize {
// TOTAL SELECTED COLLATORS PER ROUND
let x in 8..100;
// DELEGATIONS
let y in 0..(<<T as Config>::MaxTopDelegationsPerCandidate as Get<u32>>::get() * 100);
let y in 0..(<<T as Config>::MaxTopDelegationsPerCandidate as Get<u32>>::get() * 5);
let max_delegators_per_collator=
<<T as Config>::MaxTopDelegationsPerCandidate as Get<u32>>::get();
let max_delegations = x * max_delegators_per_collator;
Expand Down Expand Up @@ -932,7 +933,7 @@ benchmarks! {
// SET collators as authors for blocks from now - end
while now < end {
let author = collators[counter % collators.len()].clone();
Pallet::<T>::note_author(author);
Pallet::<T>::note_author(author.clone());
<frame_system::Pallet<T>>::on_finalize(<frame_system::Pallet<T>>::block_number());
<frame_system::Pallet<T>>::set_block_number(
<frame_system::Pallet<T>>::block_number() + 1u32.into()
Expand Down
19 changes: 3 additions & 16 deletions pallets/parachain-staking/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1595,22 +1595,9 @@ pub mod pallet {
.map(|mut bond| {
bond.amount = match requests.get(&bond.owner) {
None => bond.amount,
Some(DelegationAction::Revoke(_)) => {
log::warn!(
"reward for delegator '{:?}' set to zero due to pending \
revoke request",
bond.owner
);
BalanceOf::<T>::zero()
},
Some(DelegationAction::Decrease(amount)) => {
log::warn!(
"reward for delegator '{:?}' reduced by set amount due to pending \
decrease request",
bond.owner
);
bond.amount.saturating_sub(*amount)
},
Some(DelegationAction::Revoke(_)) => BalanceOf::<T>::zero(),
Some(DelegationAction::Decrease(amount)) =>
bond.amount.saturating_sub(*amount),
};

bond
Expand Down
278 changes: 139 additions & 139 deletions pallets/parachain-staking/src/weights.rs

Large diffs are not rendered by default.

4 changes: 1 addition & 3 deletions runtime/litentry/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,7 @@ runtime-benchmarks = [
"pallet-democracy/runtime-benchmarks",
"pallet-membership/runtime-benchmarks",
"pallet-multisig/runtime-benchmarks",
# This module timed out for some reason and had to be commented out temporarily
# https://github.com/litentry/litentry-parachain/actions/runs/3155868677/jobs/5134984739
# "pallet-parachain-staking/runtime-benchmarks",
"pallet-parachain-staking/runtime-benchmarks",
"pallet-preimage/runtime-benchmarks",
"pallet-proxy/runtime-benchmarks",
"pallet-scheduler/runtime-benchmarks",
Expand Down
4 changes: 1 addition & 3 deletions runtime/litentry/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -937,9 +937,7 @@ mod benches {
[pallet_scheduler, Scheduler]
[pallet_preimage, Preimage]
[pallet_session, SessionBench::<Runtime>]
// Since this module benchmark times out, comment it out for now
// https://github.com/litentry/litentry-parachain/actions/runs/3155868677/jobs/5134984739
// [pallet_parachain_staking, ParachainStaking]
[pallet_parachain_staking, ParachainStaking]
[cumulus_pallet_xcmp_queue, XcmpQueue]
[pallet_bridge,ChainBridge]
[pallet_bridge_transfer,BridgeTransfer]
Expand Down
Loading