innerring: Relax container homomorphic hashing check
Some checks failed
DCO action / DCO (pull_request) Failing after 36s
Vulncheck / Vulncheck (pull_request) Successful in 53s
Build / Build Components (pull_request) Successful in 1m23s
Pre-commit hooks / Pre-commit (pull_request) Successful in 1m25s
Tests and linters / gopls check (pull_request) Successful in 2m35s
Tests and linters / Tests with -race (pull_request) Successful in 3m16s
Tests and linters / Run gofumpt (pull_request) Successful in 4m33s
Tests and linters / Lint (pull_request) Successful in 4m46s
Tests and linters / Staticcheck (pull_request) Successful in 4m55s
Tests and linters / Tests (pull_request) Successful in 5m24s

Our initial desire was to prohibit using homomorphic hashing on the
network level because of the resource consumption. However, the ability
to use it, doesn't mean that we must. So only fail validation if
container wants to have homomorphic hashing, but the network prohibits
it.

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
Evgenii Stratonikov 2025-01-30 16:27:48 +03:00
parent 78bfd12229
commit b8659dfd53
Signed by: fyrchik
SSH key fingerprint: SHA256:m/TTwCzjnRkXgnzEx9X92ccxy1CcVeinOgDb3NPWWmg

View file

@ -209,7 +209,7 @@ func checkHomomorphicHashing(ns NetworkState, cnr containerSDK.Container) error
return fmt.Errorf("could not get setting in contract: %w", err)
}
if cnrSetting := containerSDK.IsHomomorphicHashingDisabled(cnr); netSetting != cnrSetting {
if cnrSetting := containerSDK.IsHomomorphicHashingDisabled(cnr); netSetting && !cnrSetting {
return fmt.Errorf("network setting: %t, container setting: %t", netSetting, cnrSetting)
}