Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
cthulhu-rider opened this issue May 2, 2023 · 3 comments
Open
Labels
enhancement Improving existing functionality I3 Minimal impact nns NNS contract related issue S3 Minimally significant U4 Nothing urgent

Comments

@cthulhu-rider
Copy link
Contributor

cthulhu-rider commented 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

@cthulhu-rider cthulhu-rider added enhancement Improving existing functionality discussion Open discussion of some problem labels May 2, 2023
@cthulhu-rider
Copy link
Contributor Author

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

@roman-khimov
Copy link
Member

(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.

@AnnaShaleva
Copy link
Member

AnnaShaleva commented 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.

@roman-khimov roman-khimov added nns NNS contract related issue U4 Nothing urgent S3 Minimally significant I3 Minimal impact and removed discussion Open discussion of some problem labels Dec 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improving existing functionality I3 Minimal impact nns NNS contract related issue S3 Minimally significant U4 Nothing urgent
Projects
None yet
Development

No branches or pull requests

3 participants