Try   HackMD

Head Ambassador Removal

Tutorial on how to remove a current Head Ambassador. They need to appear in this list for it to work. Note that they can immediately re-apply after being removed.

1. Prepare the Preimage on the Collectives Chain

  • Go to PolkadotJS and decode this extrinsic.
  • Click on Submission to modify the parameters:
  • Screenshot 2024-06-11 at 10.17.50
  • Replace the addess who with the HA that you want to remove.
  • Copy the encoded call data (not the hash!)
    Screenshot 2024-07-16 at 20.06.02
  • This will look different for everyone.

2. Prepare the Preimage on the Relay chain

  • Go to the Relay chain with this link.
  • Click on Submission again and paste the preimage from above in the call: XcmDoubleEncoded field in the bottom:
    Screenshot 2024-06-11 at 10.24.33
  • Once you are done, again copy the encoded call data (not the hash!)

3. Place the preimage on the Relay Chain

  • Go to Developer->Extrinsic
  • Create a Preimage::notePreimage(bytes) extrinsic.
  • The bytes are pasted from the relay preimage that we created above.
  • Screenshot 2024-06-11 at 10.39.09
  • Click on Submit Transaction. Note that it will reserve a deposit for the preimage; having about 50 DOT on the address is a good idea.
  • Go to Governance->Preimages and find your preimage there:
  • It should look something like this:
    Screenshot 2024-07-16 at 19.09.48
  • Copy the Hash and Length for later.
  • If you want to double-check these values, you can go to Developer->Storage and query Preimage::preimageFor with these details. It should print the Relay Preimage that was pasted in there earlier:
    Screenshot 2024-06-11 at 10.47.03

4. Create Referendum

5. Offboarding

  • Last step is to offboard the HA from the Core pallet after they were removed from the Collective with AmbassadorCore::offboard(who).
  • Anyone can call this, but not root. Therefore you have to do this manually after the referendum passed.
  • It should produce an event like this.
    Screenshot 2024-07-16 at 20.04.22

6. Testing

  • Clone the moonbeam-tools repo.
  • Run a local chopstick fork of the Polkadot Relay and Collectives parachain with: npx @acala-network/chopsticks@latest xcm -r polkadot -p polkadot-collectives. For me locally this only works with @0.12 instead of @latest, maybe a bug in Chopsticks.
  • Run the proposal with: npx ts-node src/tools/fast-execute-chopstick-proposal.ts --url ws://localhost:8001 --proposal-index NUMBER Be sure to replaceNUMBER with your referendum index.
  • If you get a weird Javascript error, then try npm install first inside the repo.
  • After doing this, do the Offboarding step 5.
  • Check the state for AmbassadorCore::members and AmbassadorCollective::members that the HA was removed from both.