polkadot-sdk
polkadot-sdk copied to clipboard
Pallet assets: new status LiveAndNoPrivilege and new call revoke_all_privilege
Some coins don't want to have any privilege role once the distribution is done. We have seen that with $PINK coins which transfered its ownership to a killed proxy account, ensuring nobody can have this privilege. The issue is that this is not easily discoverable. For instance light client can't get this proof easily.
So this PR introduces:
-
new asset status: live and no privilege. Under this status all
Owner,Issuer,Freezer,Adminprivilege are null. -
new call:
revoke_all_privilege. Can be called by owner orForceOrigin, asset must be live. It set the statusLiveAndNoPrivilege, and it also freezes the metadata. -
new config associated type:
DepositDestinationOnRevocation. When owner revoke its privilege, the deposit goes to this handler. Note that if ForceOrigin callsrevoke_all_privilegethen owner get its deposit back.
bot bench cumulus-assets --pallet=pallet_assets
bot bench cumulus-assets --runtime=asset-hub-rococo --pallet=pallet_assets bot bench cumulus-assets --runtime=asset-hub-westend --pallet=pallet_assets
bot cancel 2-944d4427-747d-465a-bf68-fb13f218c003 bot cancel 3-4e934382-1e4c-4950-bd24-2e115f67cf3d bot bench cumulus-assets --runtime=asset-hub-rococo --pallet=pallet_assets bot bench cumulus-assets --runtime=asset-hub-westend --pallet=pallet_assets
Hopefully the last commit fix the CI for benchmarks
I don't know yet what is failing in CI migration tests. But I don't have time today, I will look into it tomorrow.
If it doesn't get into the tomorrow release it is ok to me.
bot fmt
bot bench cumulus-assets --runtime=asset-hub-rococo --pallet=pallet_assets bot bench cumulus-assets --runtime=asset-hub-westend --pallet=pallet_assets
bot clean
@thiolliere what is the status here?
This pull request has been mentioned on Polkadot Forum. There might be relevant details there:
https://forum.polkadot.network/t/revoke-root-priviledges/8132/4
CI should be fixed with https://github.com/paritytech/polkadot-sdk/pull/4904
Looks good except for this one question and we need an XCM program to properly burn things on Asset Hub (see https://github.com/paritytech/polkadot-sdk/pull/3940/files#diff-37cc15e938c38da98634db29e597af5b5233e3eda662e79491ded2f58c943b52R50-R81)
I added burn at relay, but I didn't test it: https://github.com/paritytech/polkadot-sdk/pull/4150/commits/3794a11d2c3b4ef959bf0fea15b57b89a9930b36
Note that I can refactor it inside assets common if needed. I followed the design of coretime PR so I duplicated it in both westend and rococo.
Note that I can refactor it inside assets common if needed. I followed the design of coretime PR so I duplicated it in both westend and rococo.
Yeah, looks good now. We do need a test, but @seadanda was going to work on a test for the Coretime one. I agree this should be refactored and be available somewhere that any system para can use the type.
We do need a test
where are end-to-end test for westend and rococo?
https://github.com/paritytech/polkadot-sdk/tree/master/cumulus/parachains/integration-tests/emulated
I added a integration test for Assets: https://github.com/paritytech/polkadot-sdk/pull/4150/commits/6976d91c21314c85d1b6fd099e71196bf50a04df
Maybe a similar test should be written for PoolAssets And ForeignAssets. But at least the code is covered for BurnAtRelay
Testing the coretime XCMs end to end was non-trivial as they are sent by the runtime at various points. We need to trigger a session change on the relay for it to fire the XCM for notify core count, but emulated tests previously had a fairly limited idea of time passing. I've added to the emulator test environment to support running hooks and the other tests are working, but the session still doesn't change so I'm just investigating that.
Testing this XCM should be relatively straightforward if we just send it manually in an AH - relay test
I agree this should be refactored and be available somewhere that any system para can use the type.
I was thinking only refactoring for westend and rococo, not for other usecase. The code is small, an abstraction can only fit for parachains using DOT as currency and who wants to give away the money from deposit when it is burned.
Actually any non-system parachain should rather keep the deposit for themselves as it is them who hold the storage data.
The CI pipeline was cancelled due to failure one of the required jobs. Job name: test-linux-stable-int Logs: https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/7138716