Polymesh icon indicating copy to clipboard operation
Polymesh copied to clipboard

Mesh 2149/staking update part2

Open HenriqueNogara opened this issue 8 months ago • 0 comments

changelog

new features

  • The follosing extrinsics have been added: kick, set_staking_configs, chill_other, force_apply_min_commission, set_min_commission;

modified external API

  • StakingLedger::unlocking and StakingLedger::claimed_rewards types changed from Vec to BoundedVec;

  • The following extrinsics were removed: set_min_bond_threshold, set_history_depth, submit_election_solution, submit_election_solution_unsigned;

  • The following events have been removed: StakingElection, SolutionStored, MinimumBondThresholdUpdated;

  • Adds the following error variants: DuplicateIndex, InsufficientBond, InvalidNumberOfNominations, IncorrectHistoryDepth, CannotChillOther, TooManyValidators, CommissionTooLow, IdentityIsAlreadyPermissioned, IdentityIsMissingCDD, IdentityNotFound, ValidatorNotFound;

  • Removes the following error variants: InsufficientValue, OffchainElectionEarlySubmission, OffchainElectionWeakSubmission, SnapshotUnavailable, OffchainElectionBogusWinnerCount, OffchainElectionBogusWinner, OffchainElectionBogusCompact, OffchainElectionBogusNominator, OffchainElectionBogusNomination, OffchainElectionSlashedNomination, OffchainElectionBogusSelfVote, OffchainElectionBogusEdge, OffchainElectionBogusScore, OffchainElectionBogusElectionSize, CallNotAllowed, AlreadyExists, NotExists, NoChange, InvalidValidatorIdentity, InvalidValidatorCommission, HitIntendedValidatorCount, BondTooSmall, InvalidValidatorUnbondAmount ;

new external API

  • Adds the following storage: MinNominatorBond, MinValidatorBond, MinimumActiveStake, MinCommission, MaxValidatorsCount, MaxNominatorsCount, CurrentPlannedSession, ChillThreshold;
  • Removes the following storage: EarliestUnappliedSlash, SnapshotValidators, SnapshotNominators, QueuedElected, QueuedScore, EraElectionStatus, IsCurrentSessionFinal, MinimumBondThreshold

modified events

  • All events are now in the Struct format;

new events

  • The following events have been added: StakersElected, StakingElectionFailed, Kicked, Chilled, PayoutStarted, ValidatorPrefsSet, ForceEra;

other

  • Removes ElectionCompute, ElectionResult, ElectionStatus and ElectionSize;
  • The StakingLedger::slash() function has been update to implement a a proportional slashing system;
  • Adds two parameters to the EraPayout trait;
  • Adds ConvertCurve which implements EraPayout this is needed since the associated type T::Reward no longer exists;
  • Adds SlashParams::disable_strategy;
  • In compute_slash the offending validator will be disabled only if params.disable_strategy != DisableStrategy::Never;
  • In kick_out_if_recent the offending validator will be disabled only if params.disable_strategy == DisableStrategy::Always;
  • Adds the following associated types: CurrencyBalance, ElectionProvider, GenesisElectionProvider, HistoryDepth, AdminOrigin, EraPayout, VoterList, TargetList, OnStakerSlash, BenchmarkingConfig ;
  • Removes the follosing associated types: SlashCancelOrigin, RewardCurve, ElectionLookahead, MaxIterations, MinSolutionScoreBump, UnsignedPriority, OffchainSolutionWeightLimit, RequiredAddOrigin, RequiredRemoveOrigin, RequiredCommissionOrigin, MinimumBond;
  • The following fields have been removed from GenesisConfig: min_bond_threshold;
  • The following fields have been added to GenesisConfig: min_nominator_bond, min_validator_bond, max_validator_count, max_nominator_count;
  • In do_payout_stakers call T::Reward::on_unbalanced(total_imbalance);
  • In chill_stash emit Chilled;
  • In new_session remove call to ForceEra::<T>::kill() if Forcing::ForceNew;
  • In new_session remove call to Self::close_election_window();
  • In end_era
  • In set_force_era emit ForceEra event;
  • Removes ValidateUnsigned impl for the pallet;

data migration

  • Validators storage changed from StorageMap to CountedStorageMap;
  • Nominators storage changed from StorageMap to CountedStorageMap;

HenriqueNogara avatar Jun 13 '24 12:06 HenriqueNogara