adm: Add commands to manipulate with NNS
contract #981
No reviewers
Labels
No labels
P0
P1
P2
P3
badger
frostfs-adm
frostfs-cli
frostfs-ir
frostfs-lens
frostfs-node
good first issue
triage
Infrastructure
blocked
bug
config
discussion
documentation
duplicate
enhancement
go
help wanted
internal
invalid
kludge
observability
perfomance
question
refactoring
wontfix
No milestone
No project
No assignees
4 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: TrueCloudLab/frostfs-node#981
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "acid-ant/frostfs-node:feature/932-nns-register-renew"
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?
Close #932
In scope of this PR introduced the following commands:
morph nns tokens
morph nns register
morph nns renew
morph nns get-records
morph nns update
morph nns delete-records
nns add-record
Signed-off-by: Anton Nikiforov an.nikiforov@yadro.com
adm: Add commands to manipulate withto WIP: adm: Add commands to manipulate withNNS
contractNNS
contractWIP: adm: Add commands to manipulate withto adm: Add commands to manipulate withNNS
contractNNS
contract@ -0,0 +19,4 @@
addRecordCmd.Flags().String(commonflags.AlphabetWalletsFlag, "", commonflags.AlphabetWalletsFlagDesc)
addRecordCmd.Flags().String(commonflags.NNSNameFlag, "", commonflags.NNSNameFlagDesc)
addRecordCmd.Flags().String(commonflags.NNSRecordTypeFlag, "", commonflags.NNSRecordTypeFlagDesc)
addRecordCmd.Flags().String(commonflags.NNSRecordDataFlag, "", "Domain name service record data")
Why
"Domain name service record data"
is not in constants?Thanks, moved to constant.
@ -0,0 +114,4 @@
}
func getRecordType(recordType string) (*big.Int, error) {
switch strings.ToUpper(recordType) {
AAAA
?Ooops, fixed.
5b3f315a08
tod327ee61da
@ -39,0 +46,4 @@
NNSRecordTypeFlag = "type"
NNSRecordTypeFlagDesc = "Domain name service record type(A|CNAME|SOA|TXT)"
NNSRecordDataFlag = "data"
NNSRecordDataFlagDesc = "Domain name service record data"
Why are this flags in
commonflags
package and not in NNS?Moved to
nns
and reduced visibility.@ -0,0 +16,4 @@
updateCmd.Flags().String(commonflags.NNSNameFlag, "", commonflags.NNSNameFlagDesc)
updateCmd.Flags().String(commonflags.NNSEmailFlag, constants.FrostfsOpsEmail, "Domain owner email")
updateCmd.Flags().Int64(commonflags.NNSRefreshFlag, constants.NNSRefreshDefVal,
"The number of seconds between update requests from secondary and slave name servers")
We are not writing a DNS server here, I wonder, whether this description is of any help to anyone. Why not just refer to "SOA record REFRESH parameter"
Agree, made description shorter as you proposed.
d327ee61da
to7010ec6d72
@ -36,4 +36,5 @@ const (
HomomorphicHashDisabledInitFlag = "network.homomorphic_hash_disabled"
CustomZoneFlag = "domain"
AlphabetSizeFlag = "size"
NNSNameFlag = "name"
And this one?
Shame on me. Fixed.
7010ec6d72
tof9249160dd
f9249160dd
to27942c547b
Also, ask CI guys, they could use adm in pipelines.
Manual testing and checking for receiving errors from
adm
andnns
contract.QA team informed about these changes.
This will have the same problems as policy contract: it works fine on dev-env with 1 committee node, but will fail in multi-committee scenario.
Can we make sure it doesn't fail in this scenario before merge?
27942c547b
to4773f9aedd
Added custom
Actor
. Tested successfully with dev-env and virtual environment.adm: Add commands to manipulate withto WIP: adm: Add commands to manipulate withNNS
contractNNS
contractWIP: adm: Add commands to manipulate withto adm: Add commands to manipulate withNNS
contractNNS
contract@ -0,0 +83,4 @@
// Inside the methods `MakeCall` and `SendRun` of the NeoGO's actor transaction is signing by committee account,
// because actor uses committee wallet.
// But it is not enough, need to sign with another committee accounts.
func (a *MorphActor) sign(tx *transaction.Transaction) error {
Maybe rename
sign
->resign
?Renamed.
4773f9aedd
toefa30cb2e4
@ -0,0 +83,4 @@
// Inside the methods `MakeCall` and `SendRun` of the NeoGO's actor transaction is signing by committee account,
// because actor uses committee wallet.
// But it is not enough, need to sign with another committee accounts.
func (a *MorphActor) resign(tx *transaction.Transaction) error {
It is a kludge (why sign in the first place), but probably worth because the amount of code to copy was too high?
Anyway, this makes our
MakeRun
andMakeCall
actually invalid if they are used from the outside e.g. in auto-generated bindings. What about making thempanic
to ensure we do not accidentally use them?Make sense, added
panic
for unused methods.efa30cb2e4
toe0d524e419
e0d524e419
to0d11826a16
0d11826a16
toda2be98406
da2be98406
to9c5cfd56b3
@ -0,0 +21,4 @@
"github.com/spf13/viper"
)
const errUnimplemented string = "unimplemented"
type is unnecessary, also "not implemented" is somewhat common, not sure we need constant here, like even in Go compiler:
Agree, updated.
@ -0,0 +23,4 @@
const errUnimplemented string = "unimplemented"
// MorphActor is a kludge, do not use it outside of the morph commands.
More like
LocalAuthor
?Renamed.
@ -0,0 +83,4 @@
recordTypeToString(nns.RecordType(rs[1].Value().(*big.Int).Int64())),
string(bs))
}
items, err = act.Invoker.TraverseIterator(sid, &r, 0)
Here is no check for
err
ifTraverseIterator
was not successfulThanks, missed that. Updated.
@ -0,0 +64,4 @@
}
func getRecords(cmd *cobra.Command, _ []string) {
c, act, hash := getRPCClient(cmd)
addRecord
andgetRecords
use the same function to receive RPC clientWon't we run in the same issue as #1009, namely reading alphabet wallets for methods which only read and do not sign anything?
Good catch. Added ability for read operations (
tokens
,get-records
) execute without alphabet wallets.9c5cfd56b3
to386bac6d4c
386bac6d4c
to0f6857c698
0f6857c698
toa8709d54bd
LGTM