Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tracking issue for bounding pallet-staking storage items #255

Open
kianenigma opened this issue Sep 5, 2022 · 6 comments · May be fixed by #5987
Open

Tracking issue for bounding pallet-staking storage items #255

kianenigma opened this issue Sep 5, 2022 · 6 comments · May be fixed by #5987
Assignees
Labels
D3-involved Can be fixed by an expert coder with good knowledge of the codebase. I6-meta A specific issue for grouping tasks or bugs of a specific category. T1-FRAME This PR/Issue is related to core FRAME, the framework.

Comments

@kianenigma
Copy link
Contributor

kianenigma commented Sep 5, 2022

related to #323 and paritytech/substrate#9724

If we simply remove the pallet::without_storage_info, we get an error about the following items:

Full Errors
error[E0277]: the trait bound `std::vec::Vec<<T as frame_system::Config>::AccountId>: parity_scale_codec::MaxEncodedLen` is not satisfied
  --> frame/staking/src/pallet/mod.rs:59:12
   |
59 |     #[pallet::pallet]
   |               ^^^^^^ the trait `parity_scale_codec::MaxEncodedLen` is not implemented for `std::vec::Vec<<T as frame_system::Config>::AccountId>`
   |
   = help: the following other types implement trait `parity_scale_codec::MaxEncodedLen`:
             ()
             (TupleElement0, TupleElement1)
             (TupleElement0, TupleElement1, TupleElement2)
             (TupleElement0, TupleElement1, TupleElement2, TupleElement3)
             (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4)
             (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5)
             (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6)
             (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7)
           and 78 others
   = note: required because of the requirements on the impl of `StorageInfoTrait` for `frame_support::pallet_prelude::StorageValue<_GeneratedPrefixForStorageInvulnerables<T>, std::vec::Vec<<T as frame_system::Config>::AccountId>, frame_support::pallet_prelude::ValueQuery>`

error[E0277]: the trait bound `StakingLedger<T>: parity_scale_codec::MaxEncodedLen` is not satisfied
  --> frame/staking/src/pallet/mod.rs:59:12
   |
59 |     #[pallet::pallet]
   |               ^^^^^^ the trait `parity_scale_codec::MaxEncodedLen` is not implemented for `StakingLedger<T>`
   |
   = help: the following other types implement trait `parity_scale_codec::MaxEncodedLen`:
             ()
             (TupleElement0, TupleElement1)
             (TupleElement0, TupleElement1, TupleElement2)
             (TupleElement0, TupleElement1, TupleElement2, TupleElement3)
             (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4)
             (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5)
             (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6)
             (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7)
           and 78 others
   = note: required because of the requirements on the impl of `StorageInfoTrait` for `frame_support::pallet_prelude::StorageMap<_GeneratedPrefixForStorageLedger<T>, frame_support::Blake2_128Concat, <T as frame_system::Config>::AccountId, StakingLedger<T>>`

error[E0277]: the trait bound `RewardDestination<<T as frame_system::Config>::AccountId>: parity_scale_codec::MaxEncodedLen` is not satisfied
  --> frame/staking/src/pallet/mod.rs:59:12
   |
59 |     #[pallet::pallet]
   |               ^^^^^^ the trait `parity_scale_codec::MaxEncodedLen` is not implemented for `RewardDestination<<T as frame_system::Config>::AccountId>`
   |
   = help: the following other types implement trait `parity_scale_codec::MaxEncodedLen`:
             ()
             (TupleElement0, TupleElement1)
             (TupleElement0, TupleElement1, TupleElement2)
             (TupleElement0, TupleElement1, TupleElement2, TupleElement3)
             (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4)
             (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5)
             (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6)
             (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7)
           and 78 others
   = note: required because of the requirements on the impl of `StorageInfoTrait` for `frame_support::pallet_prelude::StorageMap<_GeneratedPrefixForStoragePayee<T>, frame_support::Twox64Concat, <T as frame_system::Config>::AccountId, RewardDestination<<T as frame_system::Config>::AccountId>, frame_support::pallet_prelude::ValueQuery>`

error[E0277]: the trait bound `ValidatorPrefs: parity_scale_codec::MaxEncodedLen` is not satisfied
  --> frame/staking/src/pallet/mod.rs:59:12
   |
59 |     #[pallet::pallet]
   |               ^^^^^^ the trait `parity_scale_codec::MaxEncodedLen` is not implemented for `ValidatorPrefs`
   |
   = help: the following other types implement trait `parity_scale_codec::MaxEncodedLen`:
             ()
             (TupleElement0, TupleElement1)
             (TupleElement0, TupleElement1, TupleElement2)
             (TupleElement0, TupleElement1, TupleElement2, TupleElement3)
             (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4)
             (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5)
             (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6)
             (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7)
           and 78 others
   = note: required because of the requirements on the impl of `StorageInfoTrait` for `frame_support::pallet_prelude::CountedStorageMap<pallet::pallet::_GeneratedPrefixForStorageValidators<T>, frame_support::Twox64Concat, <T as frame_system::Config>::AccountId, ValidatorPrefs, frame_support::pallet_prelude::ValueQuery>`

error[E0277]: the trait bound `Nominations<T>: parity_scale_codec::MaxEncodedLen` is not satisfied
  --> frame/staking/src/pallet/mod.rs:59:12
   |
59 |     #[pallet::pallet]
   |               ^^^^^^ the trait `parity_scale_codec::MaxEncodedLen` is not implemented for `Nominations<T>`
   |
   = help: the following other types implement trait `parity_scale_codec::MaxEncodedLen`:
             ()
             (TupleElement0, TupleElement1)
             (TupleElement0, TupleElement1, TupleElement2)
             (TupleElement0, TupleElement1, TupleElement2, TupleElement3)
             (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4)
             (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5)
             (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6)
             (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7)
           and 78 others
   = note: required because of the requirements on the impl of `StorageInfoTrait` for `frame_support::pallet_prelude::CountedStorageMap<_GeneratedPrefixForStorageNominators<T>, frame_support::Twox64Concat, <T as frame_system::Config>::AccountId, Nominations<T>>`

error[E0277]: the trait bound `ActiveEraInfo: parity_scale_codec::MaxEncodedLen` is not satisfied
  --> frame/staking/src/pallet/mod.rs:59:12
   |
59 |     #[pallet::pallet]
   |               ^^^^^^ the trait `parity_scale_codec::MaxEncodedLen` is not implemented for `ActiveEraInfo`
   |
   = help: the following other types implement trait `parity_scale_codec::MaxEncodedLen`:
             ()
             (TupleElement0, TupleElement1)
             (TupleElement0, TupleElement1, TupleElement2)
             (TupleElement0, TupleElement1, TupleElement2, TupleElement3)
             (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4)
             (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5)
             (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6)
             (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7)
           and 78 others
   = note: required because of the requirements on the impl of `StorageInfoTrait` for `frame_support::pallet_prelude::StorageValue<_GeneratedPrefixForStorageActiveEra<T>, ActiveEraInfo>`

error[E0277]: the trait bound `Exposure<<T as frame_system::Config>::AccountId, <T as pallet::pallet::Config>::CurrencyBalance>: parity_scale_codec::MaxEncodedLen` is not satisfied
  --> frame/staking/src/pallet/mod.rs:59:12
   |
59 |     #[pallet::pallet]
   |               ^^^^^^ the trait `parity_scale_codec::MaxEncodedLen` is not implemented for `Exposure<<T as frame_system::Config>::AccountId, <T as pallet::pallet::Config>::CurrencyBalance>`
   |
   = help: the following other types implement trait `parity_scale_codec::MaxEncodedLen`:
             ()
             (TupleElement0, TupleElement1)
             (TupleElement0, TupleElement1, TupleElement2)
             (TupleElement0, TupleElement1, TupleElement2, TupleElement3)
             (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4)
             (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5)
             (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6)
             (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7)
           and 78 others
   = note: required because of the requirements on the impl of `StorageInfoTrait` for `frame_support::pallet_prelude::StorageDoubleMap<_GeneratedPrefixForStorageErasStakers<T>, frame_support::Twox64Concat, u32, frame_support::Twox64Concat, <T as frame_system::Config>::AccountId, Exposure<<T as frame_system::Config>::AccountId, <T as pallet::pallet::Config>::CurrencyBalance>, frame_support::pallet_prelude::ValueQuery>`

error[E0277]: the trait bound `EraRewardPoints<<T as frame_system::Config>::AccountId>: parity_scale_codec::MaxEncodedLen` is not satisfied
  --> frame/staking/src/pallet/mod.rs:59:12
   |
59 |     #[pallet::pallet]
   |               ^^^^^^ the trait `parity_scale_codec::MaxEncodedLen` is not implemented for `EraRewardPoints<<T as frame_system::Config>::AccountId>`
   |
   = help: the following other types implement trait `parity_scale_codec::MaxEncodedLen`:
             ()
             (TupleElement0, TupleElement1)
             (TupleElement0, TupleElement1, TupleElement2)
             (TupleElement0, TupleElement1, TupleElement2, TupleElement3)
             (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4)
             (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5)
             (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6)
             (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7)
           and 78 others
   = note: required because of the requirements on the impl of `StorageInfoTrait` for `frame_support::pallet_prelude::StorageMap<_GeneratedPrefixForStorageErasRewardPoints<T>, frame_support::Twox64Concat, u32, EraRewardPoints<<T as frame_system::Config>::AccountId>, frame_support::pallet_prelude::ValueQuery>`

error[E0277]: the trait bound `Forcing: parity_scale_codec::MaxEncodedLen` is not satisfied
  --> frame/staking/src/pallet/mod.rs:59:12
   |
59 |     #[pallet::pallet]
   |               ^^^^^^ the trait `parity_scale_codec::MaxEncodedLen` is not implemented for `Forcing`
   |
   = help: the following other types implement trait `parity_scale_codec::MaxEncodedLen`:
             ()
             (TupleElement0, TupleElement1)
             (TupleElement0, TupleElement1, TupleElement2)
             (TupleElement0, TupleElement1, TupleElement2, TupleElement3)
             (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4)
             (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5)
             (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6)
             (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7)
           and 78 others
   = note: required because of the requirements on the impl of `StorageInfoTrait` for `frame_support::pallet_prelude::StorageValue<_GeneratedPrefixForStorageForceEra<T>, Forcing, frame_support::pallet_prelude::ValueQuery>`

error[E0277]: the trait bound `std::vec::Vec<UnappliedSlash<<T as frame_system::Config>::AccountId, <T as pallet::pallet::Config>::CurrencyBalance>>: parity_scale_codec::MaxEncodedLen` is not satisfied
  --> frame/staking/src/pallet/mod.rs:59:12
   |
59 |     #[pallet::pallet]
   |               ^^^^^^ the trait `parity_scale_codec::MaxEncodedLen` is not implemented for `std::vec::Vec<UnappliedSlash<<T as frame_system::Config>::AccountId, <T as pallet::pallet::Config>::CurrencyBalance>>`
   |
   = help: the following other types implement trait `parity_scale_codec::MaxEncodedLen`:
             ()
             (TupleElement0, TupleElement1)
             (TupleElement0, TupleElement1, TupleElement2)
             (TupleElement0, TupleElement1, TupleElement2, TupleElement3)
             (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4)
             (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5)
             (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6)
             (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7)
           and 78 others
   = note: required because of the requirements on the impl of `StorageInfoTrait` for `frame_support::pallet_prelude::StorageMap<_GeneratedPrefixForStorageUnappliedSlashes<T>, frame_support::Twox64Concat, u32, std::vec::Vec<UnappliedSlash<<T as frame_system::Config>::AccountId, <T as pallet::pallet::Config>::CurrencyBalance>>, frame_support::pallet_prelude::ValueQuery>`

error[E0277]: the trait bound `std::vec::Vec<(u32, u32)>: parity_scale_codec::MaxEncodedLen` is not satisfied
  --> frame/staking/src/pallet/mod.rs:59:12
   |
59 |     #[pallet::pallet]
   |               ^^^^^^ the trait `parity_scale_codec::MaxEncodedLen` is not implemented for `std::vec::Vec<(u32, u32)>`
   |
   = help: the following other types implement trait `parity_scale_codec::MaxEncodedLen`:
             ()
             (TupleElement0, TupleElement1)
             (TupleElement0, TupleElement1, TupleElement2)
             (TupleElement0, TupleElement1, TupleElement2, TupleElement3)
             (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4)
             (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5)
             (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6)
             (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7)
           and 78 others
   = note: required because of the requirements on the impl of `StorageInfoTrait` for `frame_support::pallet_prelude::StorageValue<_GeneratedPrefixForStorageBondedEras<T>, std::vec::Vec<(u32, u32)>, frame_support::pallet_prelude::ValueQuery>`

error[E0277]: the trait bound `slashing::SlashingSpans: parity_scale_codec::MaxEncodedLen` is not satisfied
  --> frame/staking/src/pallet/mod.rs:59:12
   |
59 |     #[pallet::pallet]
   |               ^^^^^^ the trait `parity_scale_codec::MaxEncodedLen` is not implemented for `slashing::SlashingSpans`
   |
   = help: the following other types implement trait `parity_scale_codec::MaxEncodedLen`:
             ()
             (TupleElement0, TupleElement1)
             (TupleElement0, TupleElement1, TupleElement2)
             (TupleElement0, TupleElement1, TupleElement2, TupleElement3)
             (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4)
             (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5)
             (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6)
             (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7)
           and 78 others
   = note: required because of the requirements on the impl of `StorageInfoTrait` for `frame_support::pallet_prelude::StorageMap<_GeneratedPrefixForStorageSlashingSpans<T>, frame_support::Twox64Concat, <T as frame_system::Config>::AccountId, slashing::SlashingSpans>`

error[E0277]: the trait bound `SpanRecord<<T as pallet::pallet::Config>::CurrencyBalance>: parity_scale_codec::MaxEncodedLen` is not satisfied
  --> frame/staking/src/pallet/mod.rs:59:12
   |
59 |     #[pallet::pallet]
   |               ^^^^^^ the trait `parity_scale_codec::MaxEncodedLen` is not implemented for `SpanRecord<<T as pallet::pallet::Config>::CurrencyBalance>`
   |
   = help: the following other types implement trait `parity_scale_codec::MaxEncodedLen`:
             ()
             (TupleElement0, TupleElement1)
             (TupleElement0, TupleElement1, TupleElement2)
             (TupleElement0, TupleElement1, TupleElement2, TupleElement3)
             (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4)
             (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5)
             (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6)
             (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7)
           and 78 others
   = note: required because of the requirements on the impl of `StorageInfoTrait` for `frame_support::pallet_prelude::StorageMap<_GeneratedPrefixForStorageSpanSlash<T>, frame_support::Twox64Concat, (<T as frame_system::Config>::AccountId, u32), SpanRecord<<T as pallet::pallet::Config>::CurrencyBalance>, frame_support::pallet_prelude::ValueQuery>`

error[E0277]: the trait bound `std::vec::Vec<(u32, bool)>: parity_scale_codec::MaxEncodedLen` is not satisfied
  --> frame/staking/src/pallet/mod.rs:59:12
   |
59 |     #[pallet::pallet]
   |               ^^^^^^ the trait `parity_scale_codec::MaxEncodedLen` is not implemented for `std::vec::Vec<(u32, bool)>`
   |
   = help: the following other types implement trait `parity_scale_codec::MaxEncodedLen`:
             ()
             (TupleElement0, TupleElement1)
             (TupleElement0, TupleElement1, TupleElement2)
             (TupleElement0, TupleElement1, TupleElement2, TupleElement3)
             (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4)
             (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5)
             (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6)
             (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7)
           and 78 others
   = note: required because of the requirements on the impl of `StorageInfoTrait` for `frame_support::pallet_prelude::StorageValue<_GeneratedPrefixForStorageOffendingValidators<T>, std::vec::Vec<(u32, bool)>, frame_support::pallet_prelude::ValueQuery>`

error[E0277]: the trait bound `Releases: parity_scale_codec::MaxEncodedLen` is not satisfied
  --> frame/staking/src/pallet/mod.rs:59:12
   |
59 |     #[pallet::pallet]
   |               ^^^^^^ the trait `parity_scale_codec::MaxEncodedLen` is not implemented for `Releases`
   |
   = help: the following other types implement trait `parity_scale_codec::MaxEncodedLen`:
             ()
             (TupleElement0, TupleElement1)
             (TupleElement0, TupleElement1, TupleElement2)
             (TupleElement0, TupleElement1, TupleElement2, TupleElement3)
             (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4)
             (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5)
             (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6)
             (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7)
           and 78 others
   = note: required because of the requirements on the impl of `StorageInfoTrait` for `frame_support::pallet_prelude::StorageValue<_GeneratedPrefixForStorageStorageVersion<T>, Releases, frame_support::pallet_prelude::ValueQuery>`

For more information about this error, try `rustc --explain E0277`.
error: could not compile `pallet-staking` due to 15 previous errors

  • Invulnerables
  • StakingLedger
  • Payee
  • Validators / ValidatorPrefs
  • Nominators / Nominations
  • ErasStakers / ErasStakersClipped / Exposure
  • ActiveEraInfo
  • ErasRewardPoints
  • Forcing
  • UnappliedSlashes
  • BondedEras
  • SlashingSpans
  • OffendingValidators
  • Releases

I categorize these into 4 groups:

  1. [Done] Trivial ones. These are generally 1 liner changes for the type to derive(MaxEncodedLen). This list includes:
  2. [Done] Bounded by HistoryDepth. This includes only StakingLedger. Also, a number of storage maps and double maps have an invariant that the number of their keys should never exceed HistoryDepth. We should detect these, and make sure they are always respected (use try_state).
  3. [Done] Bounding by MaxActiveValidators. These are storage item who's bound is missing because we don't enforce a bound on the maximum number of active validators.
  1. [Weakly bounded in this PR] Bounding by maximum number of active exposed nominators per validator, i.e. MaxBackersPerWinner. @ggwpez started doing this in Staking: Introduce MaxBackersPerWinner substrate#11935, we need someone to finish it.
  2. Slashing related storage items. These are the more scary ones, and I am not sure if and how we should bound them. The slashing code needs an overhaul in any case.

So, these are the bounds we know:

  • MaxActiveValidators:
    • Invulnerables
    • ErasRewardPoints
  • MaxBackersPerWinner
    • ErasStakers / ErasStakersClipped / Exposure
  • HistoryDepth
    • StakingLedger
  • Trivial
    • ActiveEraInfo
    • Forcing
    • Payee
    • Validators / ValidatorPrefs
    • Nominators / Nominations
      -Releases
  • Slashing, unknown
    • UnappliedSlashes
    • BondedEras
    • SlashingSpans
    • OffendingValidators

It is hard to predict all of these without actually writing the entire code. I might be wrong in some places.

  • An easy action item, which I am happy to mentor for someone external is to take care of all the trivial ones.
  • I am not sure about MaxActiveValidators. I might prefer doing it myself since it is rather important and touches a few pallets. Nonetheless, I am grateful for @Doordashcon's effort here so far and will acknowledge it.
  • MaxBackersPerWinner needs completion by me and @ggwpez
  • Slashing is a project of its own.
@Doordashcon
Copy link
Contributor

Doordashcon commented Sep 6, 2022

Hello @kianenigma I'd like to keep working on MaxActiveValidators with guidance from you or anyone from your team.

As for the trivial ones, I'll look into that as well if that's alright with you.

@kianenigma
Copy link
Contributor Author

Hello @kianenigma I'd like to keep working on MaxActiveValidators with guidance from you or anyone from your team.

Then you can close the existing PRs, and build on top of paritytech/substrate@4682f3f, thanks!

@kianenigma
Copy link
Contributor Author

kianenigma commented Sep 8, 2022

@Doordashcon please note that @Ank4n will be looking into HistoryDepth and generally push forward this tracking issue.

@Doordashcon
Copy link
Contributor

Dropping this

@juangirini juangirini transferred this issue from paritytech/substrate Aug 24, 2023
@the-right-joyce the-right-joyce added I6-meta A specific issue for grouping tasks or bugs of a specific category. C1-mentor A task where a mentor is available. Please indicate in the issue who the mentor could be. T1-FRAME This PR/Issue is related to core FRAME, the framework. D3-involved Can be fixed by an expert coder with good knowledge of the codebase. and removed J1-meta labels Aug 25, 2023
@kianenigma kianenigma removed the C1-mentor A task where a mentor is available. Please indicate in the issue who the mentor could be. label Feb 5, 2024
@kianenigma
Copy link
Contributor Author

kianenigma commented Feb 5, 2024

This should be done as a part of #2199.

@Ank4n @gpestana please double-check that the above assumption is true. In this case, I don't see any room for mentoring here anymore.

@Ank4n
Copy link
Contributor

Ank4n commented Mar 7, 2024

Updated list of unbounded storage items

  • Invulnerables: Initial set of validators. Ideally not more than 4. Can be bounded by some number in the range (4-10).
  • ErasStakers: This is deprecated and will be removed once 84 eras have passed after runtime (polkadot and kusama) is upgraded to 1.5.0. Handled in [pallet-staking] Clean up stale non paged exposure storages in the pallet #5986.
  • ErasStakersClipped: Same as ErasStakers. Handled in [pallet-staking] Clean up stale non paged exposure storages in the pallet #5986.
  • ErasStakersPaged: Will be bounded once we reduce exposure page size to a low value (like 128 or 32).
  • ClaimedRewards: Unbounded exposure pages. We could bound it to MaxNominatorsCount/page_size.
  • ErasRewardPoints: unbounded validator count. Could be bounded to ValidatorCount.
  • UnappliedSlashes: Need to bound reporters and pagify stakers to be slashed. Unbounded count of unapplied slashes. Can be bounded by Slash defer duration.
  • BondedEras: Can be bounded by bounding duration.
  • SlashingSpans: Slashing span is one or more eras. Can be bounded by unbonding duration.
  • OffendingValidators: Unbounded by count of offending validators. Can be bounded by desired ValidatorCount.

Lot of the bounds that we need are storage items. We should probably convert them to config constants.

@Ank4n Ank4n linked a pull request Oct 8, 2024 that will close this issue
github-merge-queue bot pushed a commit that referenced this issue Nov 5, 2024
This PR updates litep2p to the latest release.

- `KademliaEvent::PutRecordSucess` is renamed to fix word typo
- `KademliaEvent::GetProvidersSuccess` and
`KademliaEvent::IncomingProvider` are needed for bootnodes on DHT work
and will be utilized later


### Added

- kad: Providers part 8: unit, e2e, and `libp2p` conformance tests
([#258](paritytech/litep2p#258))
- kad: Providers part 7: better types and public API, public addresses &
known providers ([#246](paritytech/litep2p#246))
- kad: Providers part 6: stop providing
([#245](paritytech/litep2p#245))
- kad: Providers part 5: `GET_PROVIDERS` query
([#236](paritytech/litep2p#236))
- kad: Providers part 4: refresh local providers
([#235](paritytech/litep2p#235))
- kad: Providers part 3: publish provider records (start providing)
([#234](paritytech/litep2p#234))

### Changed

- transport_service: Improve connection stability by downgrading
connections on substream inactivity
([#260](paritytech/litep2p#260))
- transport: Abort canceled dial attempts for TCP, WebSocket and Quic
([#255](paritytech/litep2p#255))
- kad/executor: Add timeout for writting frames
([#277](paritytech/litep2p#277))
- kad: Avoid cloning the `KademliaMessage` and use reference for
`RoutingTable::closest`
([#233](paritytech/litep2p#233))
- peer_state: Robust state machine transitions
([#251](paritytech/litep2p#251))
- address_store: Improve address tracking and add eviction algorithm
([#250](paritytech/litep2p#250))
- kad: Remove unused serde cfg
([#262](paritytech/litep2p#262))
- req-resp: Refactor to move functionality to dedicated methods
([#244](paritytech/litep2p#244))
- transport_service: Improve logs and move code from tokio::select macro
([#254](paritytech/litep2p#254))

### Fixed

- tcp/websocket/quic: Fix cancel memory leak
([#272](paritytech/litep2p#272))
- transport: Fix pending dials memory leak
([#271](paritytech/litep2p#271))
- ping: Fix memory leak of unremoved `pending_opens`
([#274](paritytech/litep2p#274))
- identify: Fix memory leak of unused `pending_opens`
([#273](paritytech/litep2p#273))
- kad: Fix not retrieving local records
([#221](paritytech/litep2p#221))

See release changelog for more details:
https://github.com/paritytech/litep2p/releases/tag/v0.8.0

cc @paritytech/networking

---------

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Co-authored-by: Dmitry Markin <dmitry@markin.tech>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
D3-involved Can be fixed by an expert coder with good knowledge of the codebase. I6-meta A specific issue for grouping tasks or bugs of a specific category. T1-FRAME This PR/Issue is related to core FRAME, the framework.
Projects
Status: ⌛️ Sometime-soon
Status: In progress
Status: To Do
Development

Successfully merging a pull request may close this issue.

5 participants