ape add-rule-chain
uses incorrect alphabet multisignature account #1393
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 project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: TrueCloudLab/frostfs-node#1393
Loading…
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?
Expected Behavior
frostfs-adm morph ape add-rule-chain
should succeed when we provide all alphabet wallets via--alphabet-wallets
directory - regardless of how many alphabet members there are.Current Behavior
With 7-letter alphabet
committee
andconsensus
accounts do not match (as expected).ape add-rule-chain
usescommittee
account to sign the transaction. It fails because policy contract allowsAddChain
only to storage admin and toconsensus
alphabet account (returned by common.AlphabetAddress):func checkAuthorization(ctx storage.Context) {
admin := getAdmin(ctx)
if admin != nil && runtime.CheckWitness(admin) {
return
}
if runtime.CheckWitness(common.AlphabetAddress()) {
return
}
panic(ErrNotAuthorized)
}
Possible Solution
There are multiple possible solutions:
frostfs-adm
to use correct alphabet account (consensus
) when signing the transactioncommittee
account:consensus
accountconsensus
accountSteps to Reproduce (for bugs)
frostfs-adm morph init
(should succeed)Context
I was trying to add a rule chain using 7-letter alphabet wallet:
Debugging policy contract (by sprinkling
runtime.Log
everywhere) has shown that failed transaction is signed usingcommittee
account but only admin andconsensus
account are allowed.Regression
No.
Your Environment
uname -a
):Linux hostname 6.1.0-18-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.76-1 (2024-02-01) x86_64 GNU/Linux
Related discussion in a private chat
Account selection in
frostfs-adm
happens here:for _, w := range wallets {
acc, err := GetWalletAccount(w, constants.CommitteeAccountName)
commonCmd.ExitOnErr(cmd, "can't find committee account: %w", err)
accounts = append(accounts, acc)
}
This helper is also used by
morph nns
, I'm not sure if fixing this issue will be as easy as changing line 56 toconstants.ConsensusAccountName
NewLocalActor
receive accout name #1463NewLocalActor
receive accout name #1463NewLocalActor
receive accout name #1463NewLocalActor
receive accout name #1463NewLocalActor
receive accout name #1463NewLocalActor
receive accout name #1463