Skip to content

[westend] Remove pallet_treasury from RC and clean up system parachains matchers#11763

Merged
sigurpol merged 17 commits intomasterfrom
sigurpol-cleanup-westend-treasury-accounts
Apr 16, 2026
Merged

[westend] Remove pallet_treasury from RC and clean up system parachains matchers#11763
sigurpol merged 17 commits intomasterfrom
sigurpol-cleanup-westend-treasury-accounts

Conversation

@sigurpol
Copy link
Copy Markdown
Contributor

@sigurpol sigurpol commented Apr 14, 2026

  • Remove pallet_treasury entirely from Westend relay chain.
  • Drain residual balances from the legacy py/trsry-derived account into the local DAP satellite buffer on the relay and on each Westend system parachain (bridge-hub, collectives, coretime, people).
  • Remove RelayTreasuryLocation matchers from all Westend system parachains.

Closes #11705.

NOTE: a followup PR will remove also all remaining OpenGov related pallets from RC (issue #11775, stacked PR: #11796).

…ers (#11705)

Remove pallet_treasury entirely from Westend relay chain.
Drain residual treasury funds to relay-local DAP satellite via migration.
Relay only since other system parachains have zero funds on their local treasury accounts.
Remove RelayTreasuryLocation matchers from all Westend system parachains.

Closes #11705.
@sigurpol sigurpol requested a review from a team as a code owner April 14, 2026 20:05
@sigurpol sigurpol added the T2-pallets This PR/Issue is related to a particular pallet. label Apr 14, 2026
@sigurpol
Copy link
Copy Markdown
Contributor Author

/cmd prdoc --audience runtime_dev --bump major

@sigurpol sigurpol changed the title [westend] Remove pallet_treasury from RC and clean up satellite matchers [westend] Remove pallet_treasury from RC and clean up system parachains matchers Apr 14, 2026
@sigurpol
Copy link
Copy Markdown
Contributor Author

@acatangiu , this should address your comment here (on top of the changes already landed in #11700) and should close #11705. Note that a similar issue has been opened also in the fellowship runtime (polkadot-fellows/runtimes#1144).

use xcm_executor::traits::ConvertLocation;

// Fund Fellowship Treasury from Westend Treasury and spend from Fellowship Treasury.
/// Fellowship treasury can spend funds on Asset Hub to a beneficiary.
Copy link
Copy Markdown
Contributor Author

@sigurpol sigurpol Apr 15, 2026

Choose a reason for hiding this comment

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

This test was made by two parts:

  1. Fund fellowship treasury from relay treasury (but relay treasury is now gone!)
  2. Fellowship treasury spends to Alice via FellowshipTreasury::spend from Fellows origin => still valid, independent of relay treasury

I have replaced 1. with a force_set_balance for the fellowship treasury account on AH, and kept Part 2 as-is.

This largely overlaps with the AH test create_and_claim_treasury_spend here so it might be fine to just remove this test (and related file). The main differences is that here we are using Fellows origin (enum variant) vs root , and WND vs USDT. Added value is somehow small but not null. I am fine with both approaches (keeping or 🪓 )

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Worth keeping this, imo! Using a different asset/origin combination is indeed added value, however small; I don't think the second or two it takes to run this negatively offsets that value 👍

Comment thread polkadot/runtime/westend/src/lib.rs Outdated
@@ -189,6 +189,8 @@ pub type Migrations = (
// permanent
pallet_xcm::migration::MigrateToLatestXcmVersion<Runtime>,
cumulus_pallet_aura_ext::migration::MigrateV0ToV1<Runtime>,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

(unrelated to this PR) move this above the // permanent in the list of migrations since it should not be permanent - actually I think this already ran a long time ago and should just be removed (same for most/all above)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I would prefer to do a cleanup of all non permanent migrations we can remove in an ad-hoc PR since, as you have mentioned, it's not in the scope of this one (but I agree that it should be tackled as part of our spring cleaning tasks 😃 ). I have created #11771 as umbrella issue to do cleanup of all these migrations.

Comment on lines +192 to +193
// #11705: drain residual relay-treasury XCM payouts into DAP satellite.
pallet_dap_satellite::migrations::DrainLegacyTreasuryToDapSatellite<Runtime>,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this is intended as a "permanent" migration, right? aka keep it around until we see there is no more activity on the legacy treasury account?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

it's idempotent so doesn't hurt but it is meant to be one-shot only and then can be removed since there should be no activity on this account - so should live above permanent. Moved.

PalletInstance(<Uniques as PalletInfoAccess>::index() as u8).into();
pub CheckingAccount: AccountId = PolkadotXcm::check_account();
pub StakingPot: AccountId = CollatorSelection::account_id();
pub RelayTreasuryLocation: Location = (Parent, PalletInstance(westend_runtime_constants::TREASURY_PALLET_ID)).into();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

does this need a migration too? or is it empty on AH?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

it's empty on AH post AHM so this is just code cleanup and AFAIU no post-AHM flow needs that Location to have execution/fee privileges and no further migration is needed.

Comment thread cumulus/parachains/runtimes/assets/asset-hub-westend/src/xcm_config.rs Outdated
Comment thread cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/src/xcm_config.rs Outdated
Comment thread cumulus/parachains/runtimes/coretime/coretime-westend/src/lib.rs
Comment thread cumulus/parachains/runtimes/people/people-westend/src/xcm_config.rs
Comment thread substrate/frame/dap-satellite/src/migrations.rs
Comment thread substrate/frame/dap-satellite/src/migrations.rs Outdated
Comment on lines -478 to -481
// StakingAdmin pluralistic body.
pub const StakingAdminBodyId: BodyId = BodyId::Defense;
// FellowshipAdmin pluralistic body.
pub const FellowshipAdminBodyId: BodyId = BodyId::Index(FELLOWSHIP_ADMIN_INDEX);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

why are these not used anymore? I guess it was using the RC ones and those no longer exist, but they still exist on AH/Collectives, no? confused 🙈

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

My understanding - to be double-checked: this was and is dead / unused code.

The aliases being removed (*ToPlurality, *BodyId, LocalPalletOriginToLocation) were defined but never referenced.
SendXcmOrigin uses LocalOriginToLocation

impl pallet_xcm::Config for Runtime {
	type RuntimeEvent = RuntimeEvent;
	type SendXcmOrigin = EnsureXcmOrigin<RuntimeOrigin, LocalOriginToLocation>; // <--- HERE

LocalPalletOriginToLocation was not used.

@github-actions
Copy link
Copy Markdown
Contributor

Review required! Latest push from author must always be reviewed

Removed pallet_conviction_voting, pallet_referenda, pallet_custom_origins,
and pallet_whitelist from the Westend relay chain runtime. Governance now
lives on AssetHub.

- Re-rooted all EitherOf<EnsureRoot, GovernanceOrigin> to plain EnsureRoot
- Added RemovePallet migrations for ConvictionVoting, Referenda, Origins,
  and Whitelist
- Replaced ParentOrParentsPlurality with IsParentsOnly<ConstU8<1>> on all
  5 Westend system parachains (dead code post-governance removal)
- Removed relay governance integration tests (open_gov_on_relay,
  fellows_whitelist_call)

Closes #11775.
@sigurpol sigurpol added this pull request to the merge queue Apr 16, 2026
Merged via the queue into master with commit cd3eb6d Apr 16, 2026
359 of 368 checks passed
@sigurpol sigurpol deleted the sigurpol-cleanup-westend-treasury-accounts branch April 16, 2026 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

T2-pallets This PR/Issue is related to a particular pallet.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove RC and local treasury accounts

5 participants