fix(server): resolve the dotNS controller whether the gateway stores a dispatcher or the controller - #564
Merged
Conversation
TarikGul
reviewed
Sep 1, 2026
TarikGul
reviewed
Sep 1, 2026
Author
|
@TarikGul it's ready for review now. The dotns release with the change that needs this will happen by the end of the week, then we will deploy on Previewnet and Paseo. After the new contracts land there, we can prepare for mainnet launch and remove the gateway check altogether, because every deployment will only have a controller at that point. So this is just a temporary tweak. |
TarikGul
approved these changes
Sep 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This is a transitional step, deliberately shaped to avoid breaking changes after paritytech/dotns#258 .
DotnsGateway.DispatcherAddressis about to change meaning. Today it holds aRootGatewayDispatcher, anddiscover_pop_controllercallsTARGET()on it to reach theDotnsPopController. paritytech/dotns#258 moves the substrate Root check into the controller itself, after which the dispatcher has no purpose and the gateway pallet gets repointed at the controller proxy viaset_dispatcher_address. From that moment the stored address has noTARGET(), discovery errors, and host username resolution stops working.Switching outright to "the stored address is the controller" would have to land in the same instant as that extrinsic, on every chain at once. Instead discovery now works out which contract it is looking at, so one binary serves both states.
TARGET()exists only on the dispatcher andprotocolRegistry()only on the controller, so a revert from one identifies the other. A revert is an answer about the contract; a node failure is not an answer at all.TARGET()protocolRegistry()Not a breaking change. On every chain as it stands the stored address is still a dispatcher,
TARGET()still answers, and the resolved controller is identical so the new branch is never reached. No configuration changes are needed, andHOST_CLI_DOTNS_POP_CONTROLLERstill overrides discovery unchanged. Nothing here waits on dotns#258 either.Temporary by design. Once every chain stores the controller, the
TARGET()hop and theprotocolRegistry()confirmation both become dead weight and discovery collapses to reading the address and using it. That cleanup is a follow-up, not part of this PR, because until then the dispatcher path is the live one on previewnet and paseo-next-v2. The cost of carrying both in the meantime is one extra reverting view per resolution after a repoint,.The identity.rs test mock still scripts the dispatcher shape (:341, :440), matching today's chains; the new unit tests cover the repointed shape. Point it at a controller later and it panics unscripted view rather than returning a wrong address.