Use bytes in control service proto definition for chainID #885
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
5 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: TrueCloudLab/frostfs-node#885
Loading…
Reference in a new issue
No description provided.
Delete branch "dkirillov/frostfs-node:feature/control_api_make_chain_id_bytes"
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?
frostfs-cli
e88f7a009b
tobd70ea3d17
WIP: feature/control_api_make_chain_id_bytesto feature/control_api_make_chain_id_bytes@ -33,1 +34,4 @@
chainID, _ := cmd.Flags().GetString(chainIDFlag)
hexEncoded, _ := cmd.Flags().GetBool(chainIDHexFlag)
if hexEncoded {
Is chain ID user-defined string? If so, then hex looks redundant
Yes, it's can be user-defined. But in case when we add local overrides from IAM service ids can be not-printable so we need some way to provide such id using
frostfs-cli
@ -64,3 +64,3 @@
var chain apechain.Chain
commonCmd.ExitOnErr(cmd, "decode error: %w", chain.DecodeBytes(c))
cmd.Println("Parsed chain:\n" + prettyJSONFormat(cmd, chain.Bytes()))
cmd.Printf("Parsed chain (chain id hex: '%x'):\n%s\n", chain.ID, prettyJSONFormat(cmd, chain.Bytes()))
Can we use
utf8.IsValid
and do not output string on false?Do you mean not output json chain or which one string?
Oh, sorry, thought it was a name.
@ -15,2 +16,3 @@
const (
chainIDFlag = "chain-id"
chainIDFlag = "chain-id"
chainIDHexFlag = "chain-id-hex"
Hex is not needed for cli, cli is for user.
Yes, but we can set overrides via IAM #885 (comment)
We need this in control service, but hex-encoding is a purely CLI thing.
Let's consider the use-case:
If this isn't a case, I can keep only this commit
Control service lists only local overrides, IAM uses contract.
IAM uses not only contract. It sets local overrides in s3/node too
@ -507,3 +507,3 @@
// Chain ID assigned for the added rule chain.
string chain_id = 2;
bytes chain_id = 2;
If we agree to use hash of the serialized chain as the key in contract, do we need this?
No, we don't need this. But then I would renane
chain_id
to something else? Probably even herebd70ea3d17
toc1cbab092e
feature/control_api_make_chain_id_bytesto Use bytes in control service proto definition for chainIDc1cbab092e
to474aff315c