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

Governance V2 on CGP #1143

Closed
joepetrowski opened this issue Apr 5, 2022 · 7 comments
Closed

Governance V2 on CGP #1143

joepetrowski opened this issue Apr 5, 2022 · 7 comments
Assignees
Labels
J0-enhancement An additional feature request. J1-meta A specific issue for grouping tasks or bugs of a specific category. T6-XCM This PR/Issue is related to XCM. T7-system_parachains This PR/Issue is related to System Parachains.

Comments

@joepetrowski
Copy link
Contributor

Statemint/e runtimes make use of several origins assuming an ExecutiveBody on its parent chain, e.g.

pub type AssetsForceOrigin =
	EnsureOneOf<EnsureRoot<AccountId>, EnsureXcm<IsMajorityOfBody<KsmLocation, ExecutiveBody>>>;

With the introduction of paritytech/polkadot-sdk#297 / paritytech/polkadot#5205, we will need to map these Root/Executive Body calls to new origins.

@joepetrowski joepetrowski added F8-enhancement 🎁 T7-system_parachains This PR/Issue is related to System Parachains. T6-XCM This PR/Issue is related to XCM. labels Apr 5, 2022
@the-right-joyce the-right-joyce added J0-enhancement An additional feature request. J1-meta A specific issue for grouping tasks or bugs of a specific category. and removed F8-enhancement 🎁 labels Aug 12, 2022
@muharem muharem self-assigned this Oct 19, 2022
@muharem
Copy link
Contributor

muharem commented Nov 2, 2022

@joepetrowski wonder which origins from Gov v2 we wanna map into ExecutiveBody?
The last link in the issue is probably broken

@muharem
Copy link
Contributor

muharem commented Nov 2, 2022

@joepetrowski I see your comment
#1316 (comment)

@joepetrowski
Copy link
Contributor Author

  • AssetsForceOrigin: Root
  • CollatorSelectionUpdateOrigin: StakingAdmin (same as SlashCancel)
  • ControllerOrigin: Perhaps use WhitelistOrigin, (perhaps Controller should be renamed to XcmQueueOrigin?)

@gavofyork WDYT?

@muharem
Copy link
Contributor

muharem commented Nov 7, 2022

I am scoping what needs to be done to make such a mapping from new origins, will post it here later.

@muharem
Copy link
Contributor

muharem commented Nov 8, 2022

The main question is how we -

Problem: Pass exact Origin from one chain to another via XCM protocol.

Option 1.

Pass MultiLocation with Item and Origin index.

Cons:

  • no specific Junction for Origin, general Junction::GeneralIndex utilized

Examples:

for Statemine the FellowshipAdmin origin sent from Relay Chain:

MultiLocation{
    parents: 1, 
    interior: 
        Junctions::X2(
          Junction::GeneralIndex(0),  // index of Origin item, always 0 for example.
          Junction::GeneralIndex(3)) // FellowshipAdmin origin index.
}

Option 2.

Map Origins into Plurality body

Cons:

  • Plurality - pluralistic body, probably not meant to be an Origin

Examples:

for Statemine the FellowshipAdmin origin sent from Relay Chain:

let body_index = map FellowshipAdmin origin into Body Index;
MultiLocation{
    parents: 1, 
    interior: 
        Junctions::X1(
          Plurality { 
            id: BodyId::Index(body_index),
            part: BodyPart::Voice, 
          }
}

Option 3.

Pass MultiLocation with Pallet, Item and Origin index.

Cons:

  • the indexes of the origin enums must be immutable,
  • looks a bit complex, general Junction::GeneralIndex utilized

Examples:

for Statemine the FellowshipAdmin origin sent from Relay Chain:

MultiLocation{
    parents: 1, 
    interior: 
        Junctions::X3(
          Junction::PalletInstance(43), // pallet_custom_origins pallet index
          Junction::GeneralIndex(0),  // index of Origin item within any pallet, always 0. (1 for Events for example)
          Junction::GeneralIndex(3)) // FellowshipAdmin index within pallet_custom_origins:Origin
}

''''''''''

I am moving forward with option1, and will propose the implementation

@muharem
Copy link
Contributor

muharem commented Nov 14, 2022

Discussed in DM with @joepetrowski
We propose the ControllerOrigin privileges for xcmp queue to be given to Fellows origin from Relay Chain

@joepetrowski
Copy link
Contributor Author

I believe these are all sorted now. Will expect new issues if there are any operational problems.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
J0-enhancement An additional feature request. J1-meta A specific issue for grouping tasks or bugs of a specific category. T6-XCM This PR/Issue is related to XCM. T7-system_parachains This PR/Issue is related to System Parachains.
Projects
None yet
Development

No branches or pull requests

4 participants