frostfs-node/pkg/innerring/netmap.go
Alexander Chuprov eae9debc14
All checks were successful
DCO action / DCO (pull_request) Successful in 46s
Vulncheck / Vulncheck (pull_request) Successful in 1m11s
Build / Build Components (pull_request) Successful in 1m59s
Pre-commit hooks / Pre-commit (pull_request) Successful in 1m56s
Tests and linters / gopls check (pull_request) Successful in 2m51s
Tests and linters / Tests with -race (pull_request) Successful in 3m11s
Tests and linters / Run gofumpt (pull_request) Successful in 3m42s
Tests and linters / Staticcheck (pull_request) Successful in 4m23s
Tests and linters / Lint (pull_request) Successful in 4m33s
Tests and linters / Tests (pull_request) Successful in 4m44s
[#1613] morph: Add tracing for morph queries to neo-go
Signed-off-by: Alexander Chuprov <a.chuprov@yadro.com>
2025-02-05 16:37:11 +03:00

30 lines
971 B
Go

package innerring
import (
"context"
"fmt"
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/innerring/processors/netmap/nodevalidation/state"
netmapclient "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/morph/client/netmap"
)
/*
File contains dependencies for processor of the Netmap contract's notifications.
*/
// wraps Netmap contract's client and provides state.NetworkSettings.
type networkSettings netmapclient.Client
// MaintenanceModeAllowed requests network configuration from the Sidechain
// and check allowance of storage node's maintenance mode according to it.
// Always returns state.ErrMaintenanceModeDisallowed.
func (s *networkSettings) MaintenanceModeAllowed(ctx context.Context) error {
allowed, err := (*netmapclient.Client)(s).MaintenanceModeAllowed(ctx)
if err != nil {
return fmt.Errorf("read maintenance mode's allowance from the Sidechain: %w", err)
} else if allowed {
return nil
}
return state.ErrMaintenanceModeDisallowed
}