mirror of
https://github.com/nspcc-dev/neofs-node.git
synced 2026-03-01 04:29:10 +00:00
Add an option to disable homomorhic hashing in storage nodes #510
Labels
No labels
I1
I2
I3
I4
S0
S1
S2
S3
S4
U0
U1
U2
U3
U4
blocked
bug
config
dependencies
discussion
documentation
enhancement
enhancement
epic
feature
go
good first issue
help wanted
neofs-adm
neofs-cli
neofs-cli
neofs-cli
neofs-ir
neofs-lens
neofs-storage
neofs-storage
performance
question
security
task
test
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
nspcc-dev/neofs-node#510
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 @alexvanin on GitHub (Apr 6, 2022).
Originally assigned to: @carpawell on GitHub.
There is a need to toggle calculation of objects' payload homomorphic hash in NeoFS environment. Disabling can speed up object formation.
Solution
API
bool homomorphic_hashing_disabledto Container message of the NeoFS API V2 protocolfunc (*Container) ApplyNetworkConfig(netmap.NetworkConfig)func (Container) AssertNetworkConfig(netmap.NetworkConfig) boolfunc SyncContainerWithNetwork(context.Context, *container.Container, *Client) errorP.S. to begin with, I propose leaving
Client.ContainerPutto accept preparedContainerstructure, and perform all preparation stages outside.Inner ring
Container approval
AssertNetworkConfigData audit
homomorphic_hashing_disabledflag is set in the container of the storage group under audit (maybeContextis the best place to store this info).Storage node
homomorphic_hashing_disabledis sethomomorphic_hashing_disabledtopayloadSizeLimiterfrom theContainerof the request context (as an optimization we can try to provide a quick access to the container for Object service e.g. from thecontext.Context)homomorphic_hashing_disabledis set in the corresponding container (maybe this isn't checked at all)NeoFS CLI
SyncContainerWithNetworkfor the container before storing it@fyrchik commented on GitHub (Apr 6, 2022):
What does this option do, exactly? For example, when I put an object via such node with a session token, would it be put without homomorphic hash?
@alexvanin commented on GitHub (Apr 6, 2022):
There are two primary use cases of the tz-hash lib in NeoFS:
I think both should be disabled if we consider global network option.
@cthulhu-rider commented on GitHub (Apr 7, 2022):
If network config, then static, right? Or at least it should be per-epoch value in order to prevent undefined behaviors.
It can also be a container config.
UPD: network config can't be static same as any other data stored in smart contract by design.
@alexvanin commented on GitHub (Apr 7, 2022):
Container is immutable so it makes sense, network configuration might be changed any time.
@realloc commented on GitHub (Apr 12, 2022):
I'd suggest using both network settings and container attribute. When network setting is toggled, it affects the attribute set in container.
@carpawell commented on GitHub (Apr 13, 2022):
@realloc, what do you mean by saying "affects the attribute set in container"? Literally changing its value?
@realloc commented on GitHub (Apr 13, 2022):
Doesn't allow to create a container with the attribute conflicting current network settings. For example if there is network setting
DisableTZHash=True, then all containers withoutDisableTZHash=Trueattribute considered invalid.@alexvanin commented on GitHub (Apr 13, 2022):
@realloc can you elaborate the concept of invalid containers? As for now, we check container validity in Alphabet nodes during container creation. Therefore container always considered as valid after approval.
Does the scheme stays the same in your proposal? Or you consider having invalid containers after creation (created before
DisableTZHashsetting toggle). If so, then describe how storage and inner ring nodes should behave with requests of invalid containers.@realloc commented on GitHub (Apr 13, 2022):
The proposed scheme just adds a step at IR container validity check. All containers created should be valid, but TZHash operations must be applied to their objects according to the attribute settings.
@cthulhu-rider commented on GitHub (Apr 14, 2022):
Final solution.
NetworkInforpc response@cthulhu-rider commented on GitHub (May 16, 2022):
Implemented in https://github.com/nspcc-dev/neofs-node/tree/feat/optional-homomorphic-hashing.