[#1628] innerring: Relax container homomorphic hashing check
All checks were successful
DCO action / DCO (pull_request) Successful in 39s
Vulncheck / Vulncheck (pull_request) Successful in 1m2s
Build / Build Components (pull_request) Successful in 1m26s
Pre-commit hooks / Pre-commit (pull_request) Successful in 1m27s
Tests and linters / Run gofumpt (pull_request) Successful in 3m1s
Tests and linters / Tests (pull_request) Successful in 3m23s
Tests and linters / Lint (pull_request) Successful in 3m26s
Tests and linters / Staticcheck (pull_request) Successful in 3m22s
Tests and linters / Tests with -race (pull_request) Successful in 3m53s
Tests and linters / gopls check (pull_request) Successful in 4m4s
Vulncheck / Vulncheck (push) Successful in 1m1s
Pre-commit hooks / Pre-commit (push) Successful in 1m23s
Build / Build Components (push) Successful in 2m13s
Tests and linters / Tests (push) Successful in 3m27s
Tests and linters / Run gofumpt (push) Successful in 3m23s
Tests and linters / Tests with -race (push) Successful in 3m51s
Tests and linters / gopls check (push) Successful in 4m6s
OCI image / Build container images (push) Successful in 4m41s
Tests and linters / Staticcheck (push) Successful in 6m39s
Tests and linters / Lint (push) Successful in 6m42s

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 b2adf1109e
commit 003d568ae2
Signed by: fyrchik
SSH key fingerprint: SHA256:m/TTwCzjnRkXgnzEx9X92ccxy1CcVeinOgDb3NPWWmg

View file

@ -209,7 +209,7 @@ func checkHomomorphicHashing(ctx context.Context, ns NetworkState, cnr container
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)
}