[#249] node: Drop subnet from IR and morph

Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
Dmitrii Stepanov 2023-04-14 13:47:08 +03:00
parent d757d881d0
commit f07d4158f5
41 changed files with 55 additions and 1935 deletions

View file

@ -10,11 +10,9 @@ import (
nmClient "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/morph/client/netmap"
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/morph/event"
netmapEvent "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/morph/event/netmap"
subnetEvent "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/morph/event/subnet"
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/util/logger"
"git.frostfs.info/TrueCloudLab/frostfs-sdk-go/netmap"
"github.com/nspcc-dev/neo-go/pkg/core/mempoolevent"
"github.com/nspcc-dev/neo-go/pkg/util"
"github.com/panjf2000/ants/v2"
"go.uber.org/zap"
)
@ -65,8 +63,6 @@ type (
netmapClient *nmClient.Client
containerWrp *container.Client
subnetContract util.Uint160
netmapSnapshot cleanupTable
handleNewAudit event.Handler
@ -92,7 +88,6 @@ type (
CleanupEnabled bool
CleanupThreshold uint64 // in epochs
ContainerWrapper *container.Client
SubnetContract *util.Uint160
HandleAudit event.Handler
AuditSettlementsHandler event.Handler
@ -111,7 +106,6 @@ const (
newEpochNotification = "NewEpoch"
addPeerNotification = "AddPeer"
updatePeerStateNotification = "UpdateState"
removeNodeNotification = "RemoveNode"
)
// New creates network map contract processor instance.
@ -137,8 +131,6 @@ func New(p *Params) (*Processor, error) {
return nil, errors.New("ir/netmap: container contract wrapper is not set")
case p.NodeValidator == nil:
return nil, errors.New("ir/netmap: node validator is not set")
case p.SubnetContract == nil:
return nil, errors.New("ir/netmap: subnet contract script hash is not set")
case p.NodeStateSettings == nil:
return nil, errors.New("ir/netmap: node state settings is not set")
}
@ -160,7 +152,6 @@ func New(p *Params) (*Processor, error) {
containerWrp: p.ContainerWrapper,
netmapSnapshot: newCleanupTable(p.CleanupEnabled, p.CleanupThreshold),
handleNewAudit: p.HandleAudit,
subnetContract: *p.SubnetContract,
handleAuditSettlements: p.AuditSettlementsHandler,
@ -182,13 +173,6 @@ func (np *Processor) ListenerNotificationParsers() []event.NotificationParserInf
var p event.NotificationParserInfo
// remove node from subnetwork event
p.SetScriptHash(np.subnetContract)
p.SetType(removeNodeNotification)
p.SetParser(subnetEvent.ParseRemoveNode)
parsers = append(parsers, p)
p.SetScriptHash(np.netmapClient.ContractAddress())
// new epoch event
@ -219,13 +203,6 @@ func (np *Processor) ListenerNotificationHandlers() []event.NotificationHandlerI
var i event.NotificationHandlerInfo
// remove node from subnetwork event
i.SetScriptHash(np.subnetContract)
i.SetType(removeNodeNotification)
i.SetHandler(np.handleRemoveNode)
handlers = append(handlers, i)
i.SetScriptHash(np.netmapClient.ContractAddress())
// new epoch handler