Skip to content

Commit 2d2b436

Browse files
authored
ir/adm: use deleteNode method to forcefully drop node (#3737)
2 parents 23b2192 + 06356d1 commit 2d2b436

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

cmd/neofs-adm/internal/modules/fschain/remove_node.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import (
88
"github.com/nspcc-dev/neo-go/pkg/io"
99
"github.com/nspcc-dev/neo-go/pkg/smartcontract/callflag"
1010
"github.com/nspcc-dev/neo-go/pkg/vm/emit"
11-
"github.com/nspcc-dev/neofs-contract/rpc/netmap"
1211
"github.com/nspcc-dev/neofs-contract/rpc/nns"
1312
"github.com/spf13/cobra"
1413
"github.com/spf13/viper"
@@ -45,8 +44,8 @@ func removeNodesCmd(cmd *cobra.Command, args []string) error {
4544

4645
bw := io.NewBufBinWriter()
4746
for i := range nodeKeys {
48-
emit.AppCall(bw.BinWriter, nmHash, "updateStateIR", callflag.All,
49-
netmap.NodeStateOffline, nodeKeys[i].Bytes())
47+
emit.AppCall(bw.BinWriter, nmHash, "deleteNode", callflag.All,
48+
nodeKeys[i].Bytes())
5049
}
5150

5251
if err := emitNewEpochCall(bw, wCtx, nmHash); err != nil {

pkg/innerring/network.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import (
99

1010
"github.com/nspcc-dev/neo-go/pkg/crypto/keys"
1111
"github.com/nspcc-dev/neo-go/pkg/util"
12-
"github.com/nspcc-dev/neofs-contract/rpc/netmap"
1312
netmapcore "github.com/nspcc-dev/neofs-node/pkg/morph/client/netmap"
1413
"go.uber.org/zap"
1514
)
@@ -101,9 +100,9 @@ func (s *Server) RequestNotary(method string, args ...[]byte) (util.Uint256, err
101100

102101
hash, err = s.netmapClient.Morph().NotaryInvoke(context.TODO(),
103102
s.netmapClient.ContractAddress(), false, 0, 1, nil,
104-
"updateStateIR", netmap.NodeStateOffline, nodePubKey.Bytes())
103+
"deleteNode", nodePubKey.Bytes())
105104
if err != nil {
106-
s.log.Warn("external request: can't invoke updateSateIR method in netmap",
105+
s.log.Warn("external request: can't invoke deleteNode method in netmap",
107106
zap.String("node pub key", nodePubKey.String()),
108107
zap.Error(err))
109108
}

0 commit comments

Comments
 (0)