adm: Remove wallet requirement for safe methods #1179

Open
achuprov wants to merge 2 commits from achuprov/frostfs-node:bugfix/remove-wallet-requirement-for-safe-methods into master
Collaborator

Close #1159

Before

frostfs-adm morph frostfsid list-namespaces -r localhost:40332
init contract invoker: can't to initialize context: can't read alphabet wallets dir: open : no such file or directory

After

 ./bin/frostfs-adm morph frostfsid list-namespaces -r localhost:40332
<root>
Close #1159 Before ``` frostfs-adm morph frostfsid list-namespaces -r localhost:40332 init contract invoker: can't to initialize context: can't read alphabet wallets dir: open : no such file or directory ``` After ``` ./bin/frostfs-adm morph frostfsid list-namespaces -r localhost:40332 <root> ```
achuprov added 3 commits 2024-06-17 12:07:31 +00:00
6f455e9b5f [#1159] adm: Remove wallet requirement for list-groups
Signed-off-by: Alexander Chuprov <a.chuprov@yadro.com>
3ea8c58bf1 [#1159] adm: Remove wallet requirement for list-subject
Signed-off-by: Alexander Chuprov <a.chuprov@yadro.com>
DCO action / DCO (pull_request) Successful in 2m0s Details
Build / Build Components (1.21) (pull_request) Failing after 2m49s Details
Build / Build Components (1.22) (pull_request) Failing after 2m51s Details
Vulncheck / Vulncheck (pull_request) Failing after 3m59s Details
Tests and linters / Lint (pull_request) Failing after 4m49s Details
Tests and linters / Staticcheck (pull_request) Failing after 4m39s Details
Tests and linters / gopls check (pull_request) Failing after 5m20s Details
Tests and linters / Tests (1.21) (pull_request) Failing after 7m57s Details
Tests and linters / Tests (1.22) (pull_request) Failing after 8m3s Details
Tests and linters / Tests with -race (pull_request) Failing after 8m0s Details
Pre-commit hooks / Pre-commit (pull_request) Successful in 9m17s Details
902c0c8ab5
[#1159] adm: Remove wallet requirement for list-namespace
Signed-off-by: Alexander Chuprov <a.chuprov@yadro.com>
achuprov force-pushed bugfix/remove-wallet-requirement-for-safe-methods from 902c0c8ab5 to 9cc1f94360 2024-06-18 15:25:27 +00:00 Compare
achuprov changed title from WIP: bugfix/remove-wallet-requirement-for-safe-methods to remove wallet requirement for safe methods 2024-06-18 16:11:39 +00:00
achuprov requested review from storage-core-committers 2024-06-18 16:11:52 +00:00
achuprov requested review from storage-core-developers 2024-06-18 16:11:54 +00:00
Collaborator

As you have exported util functions from frostfs-contract, please, could you refactor morph client for frostfsid contract here: https://git.frostfs.info/TrueCloudLab/frostfs-node/src/branch/master/pkg/morph/client/frostfsid/subject.go?

As you have exported util functions from `frostfs-contract`, please, could you refactor morph client for frostfsid contract here: [https://git.frostfs.info/TrueCloudLab/frostfs-node/src/branch/master/pkg/morph/client/frostfsid/subject.go](https://git.frostfs.info/TrueCloudLab/frostfs-node/src/branch/master/pkg/morph/client/frostfsid/subject.go)?
acid-ant reviewed 2024-06-20 07:53:22 +00:00
@ -252,3 +262,2 @@
func frostfsidListNamespaces(cmd *cobra.Command, _ []string) {
ffsid, err := newFrostfsIDClient(cmd)
commonCmd.ExitOnErr(cmd, "init contract invoker: %w", err)
c, err := helper.GetN3Client(viper.GetViper())
Collaborator

Why not to move this code to the separate function? All you need in frostfsidListNamespaces(...) is a result from commonclient.ReadIteratorItems(...).
Looks like you can reuse it in frostfsidListSubjects, frostfsidListGroups, frostfsidListGroupSubjects.

Why not to move this code to the separate function? All you need in `frostfsidListNamespaces(...)` is a result from `commonclient.ReadIteratorItems(...)`. Looks like you can reuse it in `frostfsidListSubjects`, `frostfsidListGroups`, `frostfsidListGroupSubjects`.
acid-ant changed title from remove wallet requirement for safe methods to adm: Remove wallet requirement for safe methods 2024-06-20 07:53:47 +00:00
fyrchik changed title from adm: Remove wallet requirement for safe methods to WIP: adm: Remove wallet requirement for safe methods 2024-06-20 11:28:36 +00:00
achuprov force-pushed bugfix/remove-wallet-requirement-for-safe-methods from 9cc1f94360 to 0eb0d1d0fe 2024-06-21 14:27:35 +00:00 Compare
achuprov force-pushed bugfix/remove-wallet-requirement-for-safe-methods from 0eb0d1d0fe to bd38778c1d 2024-06-21 14:37:05 +00:00 Compare
achuprov changed title from WIP: adm: Remove wallet requirement for safe methods to adm: Remove wallet requirement for safe methods 2024-06-21 14:38:29 +00:00
acid-ant reviewed 2024-06-21 16:23:28 +00:00
@ -391,28 +401,29 @@ func frostfsidRemoveSubjectFromGroup(cmd *cobra.Command, _ []string) {
}
func frostfsidListGroupSubjects(cmd *cobra.Command, _ []string) {
c, err := helper.GetN3Client(viper.GetViper())
Collaborator

Looks like here we can use initInvoker() too.

Looks like here we can use `initInvoker()` too.

could you refactor morph client for frostfsid contract here

Could you create a task for this? Would like to merge this PR ASAP.

>could you refactor morph client for frostfsid contract here Could you create a task for this? Would like to merge this PR ASAP.
fyrchik reviewed 2024-06-24 06:41:04 +00:00
@ -414,2 +425,2 @@
cmd.Printf("%s (%s)\n", address.Uint160ToString(subjAddr), subj.Name)
for _, group := range groups {
cmd.Printf("%s (%d)\n", group.Name, group.ID)

The diff seems too large: previously this method used ListGroupSubjects, now it uses ListGroups, why so?

The diff seems too large: previously this method used `ListGroupSubjects`, now it uses `ListGroups`, why so?
fyrchik reviewed 2024-06-24 06:41:08 +00:00
@ -414,2 +425,2 @@
cmd.Printf("%s (%s)\n", address.Uint160ToString(subjAddr), subj.Name)
for _, group := range groups {
cmd.Printf("%s (%d)\n", group.Name, group.ID)

The diff seems too large: previously this method used ListGroupSubjects, now it uses ListGroups, why so?

The diff seems too large: previously this method used `ListGroupSubjects`, now it uses `ListGroups`, why so?
achuprov force-pushed bugfix/remove-wallet-requirement-for-safe-methods from bd38778c1d to bbedf0eaef 2024-06-24 11:50:13 +00:00 Compare
fyrchik requested changes 2024-06-24 13:15:07 +00:00
@ -315,3 +321,2 @@
subj, err := ffsid.roCli.GetSubject(addr)
commonCmd.ExitOnErr(cmd, "get subject: %w", err)
items, err := unwrap.Array(inv.Call(nmHash, getSubjectContract, addr))

Autogenerated RPC bindings for the frostfsID have GetSubject (which is almost exactly the same as your unwrap.Array(...)), why not use those?

Autogenerated RPC bindings for the `frostfsID` have `GetSubject` (which is almost exactly the same as your `unwrap.Array(...)`), why not use those?
@achuprov
All checks were successful
Vulncheck / Vulncheck (pull_request) Successful in 3m34s
Tests and linters / Staticcheck (pull_request) Successful in 4m13s
Build / Build Components (1.21) (pull_request) Successful in 4m21s
Build / Build Components (1.22) (pull_request) Successful in 4m17s
Tests and linters / gopls check (pull_request) Successful in 4m44s
Pre-commit hooks / Pre-commit (pull_request) Successful in 5m23s
Tests and linters / Lint (pull_request) Successful in 5m27s
Tests and linters / Tests (1.21) (pull_request) Successful in 9m37s
Tests and linters / Tests with -race (pull_request) Successful in 9m47s
Tests and linters / Tests (1.22) (pull_request) Successful in 10m8s
DCO action / DCO (pull_request) Successful in 1m4s
This Pull Request doesn't have enough approvals yet. 0 of 2 approvals granted.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
Sign in to join this conversation.
No reviewers
TrueCloudLab/storage-core-developers
No Milestone
No Assignees
4 Participants
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: TrueCloudLab/frostfs-node#1179
There is no content yet.