[#447] innerring: Do not handle or call InnerRingUpdate method

This method has been removed from netmap contract. Corresponding
event from neofs contract renamed to AlphabetUpdate and should not
be processed, because alphabet updated from `RoleManagement`
contract.

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
Alex Vanin 2021-03-24 17:39:59 +03:00 committed by Alex Vanin
parent 1d1fc04ac9
commit 999ad5e1c0
4 changed files with 0 additions and 69 deletions

View file

@ -28,7 +28,6 @@ const (
approvePeerMethod = "addPeer" approvePeerMethod = "addPeer"
updatePeerStateMethod = "updateState" updatePeerStateMethod = "updateState"
setConfigMethod = "setConfigMethod" setConfigMethod = "setConfigMethod"
updateInnerRingMethod = "updateInnerRingMethod"
getNetmapSnapshotMethod = "netmap" getNetmapSnapshotMethod = "netmap"
) )
@ -94,20 +93,6 @@ func SetConfig(cli *client.Client, con util.Uint160, args *SetConfigArgs) error
) )
} }
// UpdateInnerRing invokes updateInnerRing method.
func UpdateInnerRing(cli *client.Client, con util.Uint160, list []*keys.PublicKey) error {
if cli == nil {
return client.ErrNilClient
}
rawKeys := make([][]byte, 0, len(list))
for i := range list {
rawKeys = append(rawKeys, list[i].Bytes())
}
return cli.NotaryInvoke(con, updateInnerRingMethod, rawKeys)
}
// NetmapSnapshot returns current netmap node infos. // NetmapSnapshot returns current netmap node infos.
// Consider using pkg/morph/client/netmap for this. // Consider using pkg/morph/client/netmap for this.
func NetmapSnapshot(cli *client.Client, con util.Uint160) (*netmap.Netmap, error) { func NetmapSnapshot(cli *client.Client, con util.Uint160) (*netmap.Netmap, error) {

View file

@ -72,19 +72,3 @@ func (np *Processor) handleConfig(ev event.Event) {
zap.Int("capacity", np.pool.Cap())) zap.Int("capacity", np.pool.Cap()))
} }
} }
func (np *Processor) handleUpdateInnerRing(ev event.Event) {
updIR := ev.(neofsEvent.UpdateInnerRing)
np.log.Info("notification",
zap.String("type", "update inner ring"),
)
// send event to the worker pool
err := np.pool.Submit(func() { np.processUpdateInnerRing(&updIR) })
if err != nil {
// there system can be moved into controlled degradation stage
np.log.Warn("neofs processor worker pool drained",
zap.Int("capacity", np.pool.Cap()))
}
}

View file

@ -1,23 +0,0 @@
package neofs
import (
"github.com/nspcc-dev/neofs-node/pkg/innerring/invoke"
neofsEvent "github.com/nspcc-dev/neofs-node/pkg/morph/event/neofs"
"go.uber.org/zap"
)
// Process update inner ring event by setting inner ring list value from
// main chain in side chain.
func (np *Processor) processUpdateInnerRing(list *neofsEvent.UpdateInnerRing) {
if !np.alphabetState.IsAlphabet() {
np.log.Info("non alphabet mode, ignore inner ring update")
return
}
err := invoke.UpdateInnerRing(np.morphClient, np.netmapContract,
list.Keys(),
)
if err != nil {
np.log.Error("can't relay update inner ring event", zap.Error(err))
}
}

View file

@ -71,7 +71,6 @@ const (
withdrawNotification = "Withdraw" withdrawNotification = "Withdraw"
chequeNotification = "Cheque" chequeNotification = "Cheque"
configNotification = "SetConfig" configNotification = "SetConfig"
updateIRNotification = "InnerRingUpdate"
) )
// New creates neofs mainnet contract processor instance. // New creates neofs mainnet contract processor instance.
@ -151,13 +150,6 @@ func (np *Processor) ListenerParsers() []event.ParserInfo {
config.SetParser(neofsEvent.ParseConfig) config.SetParser(neofsEvent.ParseConfig)
parsers = append(parsers, config) parsers = append(parsers, config)
// update inner ring event
updateIR := event.ParserInfo{}
updateIR.SetType(updateIRNotification)
updateIR.SetScriptHash(np.neofsContract)
updateIR.SetParser(neofsEvent.ParseUpdateInnerRing)
parsers = append(parsers, updateIR)
return parsers return parsers
} }
@ -193,13 +185,6 @@ func (np *Processor) ListenerHandlers() []event.HandlerInfo {
config.SetHandler(np.handleConfig) config.SetHandler(np.handleConfig)
handlers = append(handlers, config) handlers = append(handlers, config)
// updateIR handler
updateIR := event.HandlerInfo{}
updateIR.SetType(updateIRNotification)
updateIR.SetScriptHash(np.neofsContract)
updateIR.SetHandler(np.handleUpdateInnerRing)
handlers = append(handlers, updateIR)
return handlers return handlers
} }