mirror of
https://github.com/nspcc-dev/neofs-contract.git
synced 2026-03-01 04:28:59 +00:00
Register contract's NNS domain record in deployment transaction #144
Labels
No labels
I1
I2
I3
I4
S1
S2
S3
S4
U1
U2
U3
U4
alphabet
audit
balance
blocked
bug
config
container
discussion
documentation
enhancement
feature
go
good first issue
help wanted
neofs
neofsid
netmap
nns
nns
performance
proxy
question
reputation
security
task
test
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
nspcc-dev/neofs-contract#144
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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
_deploycallback. 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 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
@roman-khimov commented on GitHub (May 2, 2023):
No parameters, please, my dream is zero
_deployparameters (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 commented on GitHub (May 3, 2023):
The overall idea LGTM.
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
_deploymethod we can retrieve the transaction's signers usingSystem.Runtime.GetScriptContainerand Ledger'sgetTransactionSignersAPIs 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.