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

Runtime: Success value and reachable location for Polkadot Collectives benchmarks #2784

Merged
merged 3 commits into from
Jun 30, 2023

Conversation

muharem
Copy link
Contributor

@muharem muharem commented Jun 26, 2023

This Pull Request addresses two issues encountered during the benchmark run:

  1. Ranked collectives benchmarks:
    An error occurs when the benchmarks attempt to promote a member above rank 9.
    To resolve this, we have set the success value for the Root as the maximum value of u16.
    We have employed a similar approach in the Polkadot runtime.

  2. Salary pallet benchmarks:
    In the benchmark environment, sending a message to a Parachain fails due to the absence of a channel between the Parachains.
    To address this, we wrap the Pay implementation to open a channel with ensure_successful.

@muharem muharem added B0-silent Changes should not be mentioned in any release notes A0-please_review Pull request needs code review. C1-low PR touches the given topic and has a low impact on builders. T1-runtime This PR/Issue is related to the topic “runtime”. D3-trivial 🧸 PR contains trivial changes in a runtime directory that do not require an audit labels Jun 26, 2023
@@ -106,12 +106,15 @@ impl pallet_ranked_collective::Config<FellowshipCollectiveInstance> for Runtime
type WeightInfo = weights::pallet_ranked_collective::WeightInfo<Runtime>;
type RuntimeEvent = RuntimeEvent;
// Promotions and the induction of new members are serviced by `FellowshipCore` pallet instance.
type PromoteOrigin = EnsureRootWithSuccess<Self::AccountId, ConstU16<{ ranks::DAN_9 }>>;
// The maximum value of `u16` set as a success value for the root to ensure the benchmarks will pass.
type PromoteOrigin = EnsureRootWithSuccess<Self::AccountId, ConstU16<65535>>;
Copy link
Contributor

Choose a reason for hiding this comment

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

should we have this behind #[cfg(feature = "runtime-benchmarks")] and have DAN_9 if the feature is not enabled?

Copy link
Contributor

Choose a reason for hiding this comment

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

If this was pulled out into a type def then that type could also be referenced in the DemoteOrigin

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I liked this way for simplicity, both ways looks ok to me.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i added a separate promote origin for benches, please approve if looks good

@bkontur
Copy link
Contributor

bkontur commented Jun 27, 2023

to my comment above,

   To address this, we have utilized the Parent location as a destination, following the same approach used in the pallet_xcm benchmarks.

for pallet_xcm_benchmarks is it probably ok, because pallet_xcm can really use Parent in calls,
the question is if ParentAsUmp is worst case or XcmpQueue

@muharem
Copy link
Contributor Author

muharem commented Jun 28, 2023

@bkontur thanks! makes total sense to me, i am checking how to make it work more accurate

@paritytech-ci paritytech-ci requested review from a team June 28, 2023 16:44
Copy link
Contributor

@bkontur bkontur left a comment

Choose a reason for hiding this comment

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

@muharem
I cannot say if ranks::DAN_9 -> 65535 is ok or not, but besides that the rest lgtm

@gavofyork gavofyork requested a review from gilescope June 30, 2023 12:32
@gavofyork
Copy link
Member

@bkchr needs a locks review...

@bkontur
Copy link
Contributor

bkontur commented Jun 30, 2023

bot merge

@paritytech-processbot paritytech-processbot bot merged commit 63a92d2 into master Jun 30, 2023
10 checks passed
@paritytech-processbot paritytech-processbot bot deleted the muharem-collectives-bench-fix branch June 30, 2023 18:34
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. 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. D3-trivial 🧸 PR contains trivial changes in a runtime directory that do not require an audit T1-runtime This PR/Issue is related to the topic “runtime”.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants