Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Generate storage info for pallet im_online #9654

Merged
5 commits merged into from
Sep 20, 2021
Merged

Generate storage info for pallet im_online #9654

5 commits merged into from
Sep 20, 2021

Conversation

georgesdib
Copy link
Contributor

@georgesdib georgesdib commented Aug 30, 2021

Fixes part of paritytech/polkadot-sdk#323

Refactor Im Online to use WeakBoundedVec instead of Vec, and generate storage info for that pallet.

polkadot companion: paritytech/polkadot#3744

@shawntabrizi @KiChjang @thiolliere

frame/im-online/src/lib.rs Outdated Show resolved Hide resolved
frame/im-online/src/lib.rs Outdated Show resolved Hide resolved
@gui1117 gui1117 added A3-in_progress Pull request is in progress. No review needed at this stage. B0-silent Changes should not be mentioned in any release notes C1-low PR touches the given topic and has a low impact on builders. labels Aug 31, 2021
Copy link
Contributor

@gui1117 gui1117 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

apart from this last note, I think it should be good to me

frame/im-online/src/lib.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@gui1117 gui1117 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me, maybe name can be improved slightly

frame/im-online/src/lib.rs Outdated Show resolved Hide resolved
@gui1117 gui1117 added A0-please_review Pull request needs code review. D3-trivial 🧸 PR contains trivial changes in a runtime directory that do not require an audit and removed A3-in_progress Pull request is in progress. No review needed at this stage. labels Sep 14, 2021
@KiChjang
Copy link
Contributor

CI is complaining:

error[E0277]: the trait bound `frame_benchmarking::Vec<<T as pallet::Config>::AuthorityId>: EncodeLike<frame_support::WeakBoundedVec<<T as pallet::Config>::AuthorityId, <T as pallet::Config>::MaxKeys>>` is not satisfied
  --> frame/im-online/src/benchmarking.rs:49:17
   |
49 |     Keys::<T>::put(keys.clone());
   |                    ^^^^^^^^^^^^ the trait `EncodeLike<frame_support::WeakBoundedVec<<T as pallet::Config>::AuthorityId, <T as pallet::Config>::MaxKeys>>` is not implemented for `frame_benchmarking::Vec<<T as pallet::Config>::AuthorityId>`
   |
   = help: the following implementations were found:
             <frame_benchmarking::Vec<T> as EncodeLike<&[U]>>
             <frame_benchmarking::Vec<T> as EncodeLike<VecDeque<U>>>
             <frame_benchmarking::Vec<T> as EncodeLike<frame_benchmarking::Vec<U>>>
   = note: required by `frame_support::pallet_prelude::StorageValue::<Prefix, Value, QueryKind, OnEmpty>::put`

@georgesdib georgesdib closed this Sep 19, 2021
Georges Dib added 2 commits September 19, 2021 23:59
Changing some `Vec` to `WeakBoundedVec`
Adding the following bounds:
* `MaxKeys
* `MaxPeerInHeartbeats`
* `MaxPeerDataEncodingSize`
to limit the size of `WeakBoundedVec`
@georgesdib
Copy link
Contributor Author

Rebased my branch to make it cleaner and force the checks of the polkadot companion

@georgesdib georgesdib reopened this Sep 19, 2021
@gui1117 gui1117 added B3-apinoteworthy and removed B0-silent Changes should not be mentioned in any release notes labels Sep 20, 2021
@gui1117
Copy link
Contributor

gui1117 commented Sep 20, 2021

bot merge

@ghost
Copy link

ghost commented Sep 20, 2021

Waiting for commit status.

@ghost
Copy link

ghost commented Sep 20, 2021

Merge failed: "Required status check "check-labels" is in progress."

@gui1117
Copy link
Contributor

gui1117 commented Sep 20, 2021

bot merge

@ghost
Copy link

ghost commented Sep 20, 2021

Trying merge.

This pull request was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A0-please_review Pull request needs code review. C1-low PR touches the given topic and has a low impact on builders. D3-trivial 🧸 PR contains trivial changes in a runtime directory that do not require an audit
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants