Register contract's NNS domain record in deployment transaction #144

Open
opened 2025-12-28 18:08:40 +00:00 by sami · 3 comments
Owner

Originally created by @cthulhu-rider on GitHub (May 2, 2023).

Currently management of NeoFS contracts on the Sidechain completely relies on NNS: addresses (hashes) are set in corresponding domain record and used by the whole system. However, now the procedure for deploying a contract and registering domain names is not an atomic operation, because executed in separate transactions. This complicates synchronization, and also puts at risk the use of NNS as a source of up-to-date information on the status of contracts.

Proposal

Register (set) contract NNS domain in deployment transaction via _deploy callback. Fail deployment if contract domain can't be registered.

I would make this a deployment option (extra parameter). But maybe it's worth to do by default or even always.

Pls share ur Thoughts @roman-khimov @AnnaShaleva

Originally created by @cthulhu-rider on GitHub (May 2, 2023). Currently management of NeoFS contracts on the Sidechain completely relies on NNS: addresses (hashes) are set in corresponding domain record and used by the whole system. However, now the procedure for deploying a contract and registering domain names is not an atomic operation, because executed in separate transactions. This complicates synchronization, and also puts at risk the use of NNS as a source of up-to-date information on the status of contracts. ## Proposal Register (set) contract NNS domain in deployment transaction via `_deploy` callback. Fail deployment if contract domain can't be registered. I would make this a deployment option (extra parameter). But maybe it's worth to do by default or even always. Pls share ur Thoughts @roman-khimov @AnnaShaleva
Author
Owner

@cthulhu-rider commented on GitHub (May 2, 2023):

currently NeoFS contracts are not destructured, but if suddenly - then it's worth processing the domain name back to deploy

@cthulhu-rider commented on GitHub (May 2, 2023): currently NeoFS contracts are not destructured, but if suddenly - then it's worth processing the domain name back to deploy
Author
Owner

@roman-khimov commented on GitHub (May 2, 2023):

(extra parameter).

No parameters, please, my dream is zero _deploy parameters (at least in most of the cases).

But this makes sense otherwise. The only problem I see is ownership (contract owns a name of its own?) and renewals (it's the contract who will have to do it). But this can be solved.

@roman-khimov commented on GitHub (May 2, 2023): > (extra parameter). No parameters, please, my dream is zero `_deploy` parameters (at least in most of the cases). But this makes sense otherwise. The only problem I see is ownership (contract owns a name of its own?) and renewals (it's the contract who will have to do it). But this can be solved.
Author
Owner

@AnnaShaleva commented on GitHub (May 3, 2023):

The overall idea LGTM.

ownership (contract owns a name of its own?) and renewals (it's the contract who will have to do it)

We can add a domain owner as a signer to the transaction at the specified fixed place in the signers list. After that during the contract's deployment inside _deploy method we can retrieve the transaction's signers using System.Runtime.GetScriptContainer and Ledger's getTransactionSigners APIs and provide that signer as an owner argument to the NNS's registration method. If the domain owner has a proper scope, then this scheme allows to preserve the old ownership scheme and doesn't use additional arguments on _deploy.

@AnnaShaleva commented on GitHub (May 3, 2023): The overall idea LGTM. > ownership (contract owns a name of its own?) and renewals (it's the contract who will have to do it) We can add a domain owner as a signer to the transaction at the specified fixed place in the signers list. After that during the contract's deployment inside `_deploy` method we can retrieve the transaction's signers using `System.Runtime.GetScriptContainer` and Ledger's `getTransactionSigners` APIs and provide that signer as an owner argument to the NNS's registration method. If the domain owner has a proper scope, then this scheme allows to preserve the old ownership scheme and doesn't use additional arguments on `_deploy`.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
nspcc-dev/neofs-contract#144
No description provided.