substrate
substrate copied to clipboard
Name Service Pallet as Collectives Service
This PR expands on what was worked on in https://github.com/paritytech/substrate/pull/11052, getting the name service pallet to a production ready state.
The addition of a register_para and deregister_para will be added, ideally only callable via XCM over OpenGov proposals, as a mechanism for paras to be registered on the service. This will prevent arbitrary / non-existent Para IDs from being stored on the service. The set_address call within the name service resolver can then take a para_id in addition to the address itself, so the service knows which para to route addresses to.
- [x] Fix up code from #11052 to work with master and get tests working.
- [x] Review of pallet and write-up high level lib doc.
- [x] Check deposit mechanism and whether deposits should be added to subdomains too (they are).
- [x] Update header comments to match master.
- [x]
Registrationsstorage item to have counter.
- [x] Add
register_paraandderegister_paracalls to store Para IDs that wish to be a part of the name service.- [x] Use
RegistrationManagerand ensure origin isRuntimeOriginfor these calls. - [x] Provide a suffix that acts as the source of truth for the para.
- [x] Use
- [x]
set_addressto also requirepara_idarg, ensure para id is registered. - [x] Revise configs and move to storage where applicable (deposits, tiers) via a
set_configscall (similar to Nomination Poolsset_configs) for root origin to manage. - [x] Make suffixes unique, reverse lookup & set address to take suffix instead of para ID.
- [x] hash -> address, suffix -> para.
- [x] Remove controller related code in preparation for a
NameServiceCollectives proxy type. - [x] Expand call comments.
- [x] Don't unreserve deposit on reveal. Instead, assign to owner (if depositor different) to back up registration and incentivise deregistering.
- [x] Write up benchmarks and plug in call weights.
- [x] Expand pallet docs with calls.
- [x] Fix tests to account for domains & configs.
- [x] Use
domainterminology for para registrations, andnameterminology for nodes. - [x] Revisit tests and determine what needs to be added.
- [x] Add test proving that a tree of a registered TLD and subnodes can all be deregistered and removed from storage.
- [x] Bound renew max length & update benchmark.
- [ ] Cumulus Companion (Westend Collectives only): Add pallet to runtime and add a
NameServiceproxy to have access to resolver management and registration of new subdomains.
Other tasks post initial release
- Explore whether a
force_deregister_parais possible, to asynchronously query Relay Chain and remove para from name service if the para is no longer registered. - Decentralised / trustless transfer of ownership on-chain process.
bot clean
bot rebase
Rebased
bot rebase
Rebased
bot rebase
Branch is already up-to-date
bot rebase
Rebased
bot rebase
Branch is already up-to-date
bot bench $ pallet dev pallet_name_service
@rossbulat "$PIPELINE_SCRIPTS_DIR/commands/bench/bench.sh" pallet dev pallet_name_service (https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/3188692) was cancelled in https://github.com/paritytech/substrate/pull/14491#issuecomment-1635801559
bot bench $ pallet dev pallet_name_service
@rossbulat https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/3188827 was started for your command "$PIPELINE_SCRIPTS_DIR/commands/bench/bench.sh" pallet dev pallet_name_service. Check out https://gitlab.parity.io/parity/mirrors/substrate/-/pipelines?page=1&scope=all&username=group_605_bot to know what else is being executed currently.
Comment bot cancel 27-4fe4c106-3c09-4b9d-9381-d67502cc1ec3 to cancel this command or bot cancel to cancel all commands in this pull request.
bot cancel 26-9d7e5b22-92a0-4571-81b6-5877849b9bdf
@rossbulat Command "$PIPELINE_SCRIPTS_DIR/commands/bench/bench.sh" pallet dev pallet_name_service has finished. Result: https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/3188692 has finished. If any artifacts were generated, you can download them from https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/3188692/artifacts/download.
@rossbulat Command "$PIPELINE_SCRIPTS_DIR/commands/bench/bench.sh" pallet dev pallet_name_service has finished. Result: https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/3188827 has finished. If any artifacts were generated, you can download them from https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/3188827/artifacts/download.
bot bench $ pallet dev pallet_name_service
@rossbulat https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/3189239 was started for your command "$PIPELINE_SCRIPTS_DIR/commands/bench/bench.sh" pallet dev pallet_name_service. Check out https://gitlab.parity.io/parity/mirrors/substrate/-/pipelines?page=1&scope=all&username=group_605_bot to know what else is being executed currently.
Comment bot cancel 28-a92b1d43-821d-4760-bca0-15dadecbfdbf to cancel this command or bot cancel to cancel all commands in this pull request.
bot rebase
Rebased
@rossbulat Command "$PIPELINE_SCRIPTS_DIR/commands/bench/bench.sh" pallet dev pallet_name_service has finished. Result: https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/3189239 has finished. If any artifacts were generated, you can download them from https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/3189239/artifacts/download.
bot rebase
Rebased
This pull request has been mentioned on Polkadot Forum. There might be relevant details there:
https://forum.polkadot.network/t/name-service-pallet-introduction-and-call-for-frame-devs-to-review/3480/1
bot rebase
Rebased
Love this! 🚀 Left mostly comments about documentation.
Super appreciated @franciscoaguirre , this is exactly the FRAME expertise the pallet needs. 💪
The CI pipeline was cancelled due to failure one of the required jobs. Job name: cargo-check-benches Logs: https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/3322490