[#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

@ -17,7 +17,6 @@ import (
nodevalidator "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/innerring/processors/netmap/nodevalidation"
addrvalidator "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/innerring/processors/netmap/nodevalidation/maddress"
statevalidation "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/innerring/processors/netmap/nodevalidation/state"
subnetvalidator "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/innerring/processors/netmap/nodevalidation/subnet"
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/innerring/processors/settlement"
auditSettlement "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/innerring/processors/settlement/audit"
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/metrics"
@ -28,7 +27,6 @@ import (
frostfsClient "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/morph/client/frostfs"
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/morph/client/frostfsid"
nmClient "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/morph/client/netmap"
morphsubnet "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/morph/client/subnet"
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/morph/event"
audittask "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/services/audit/taskmanager"
control "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/services/control/ir"
@ -46,7 +44,6 @@ import (
func (s *Server) initNetmapProcessor(cfg *viper.Viper,
cnrClient *container.Client,
alphaSync event.Handler,
subnetClient *morphsubnet.Client,
auditProcessor *audit.Processor,
settlementProcessor *settlement.Processor) error {
locodeValidator, err := s.newLocodeValidator(cfg)
@ -54,11 +51,6 @@ func (s *Server) initNetmapProcessor(cfg *viper.Viper,
return err
}
subnetValidator, err := subnetvalidator.New(
subnetvalidator.Prm{
SubnetClient: subnetClient,
},
)
if err != nil {
return err
}
@ -94,10 +86,8 @@ func (s *Server) initNetmapProcessor(cfg *viper.Viper,
&netMapCandidateStateValidator,
addrvalidator.New(),
locodeValidator,
subnetValidator,
),
NotaryDisabled: s.sideNotaryConfig.disabled,
SubnetContract: &s.contracts.subnet,
NodeStateSettings: netSettings,
})
@ -349,27 +339,6 @@ func (s *Server) initTimers(cfg *viper.Viper, processors *serverProcessors, morp
s.addBlockTimer(emissionTimer)
}
func (s *Server) createMorphSubnetClient() (*morphsubnet.Client, error) {
// initialize morph client of Subnet contract
clientMode := morphsubnet.NotaryAlphabet
if s.sideNotaryConfig.disabled {
clientMode = morphsubnet.NonNotary
}
subnetInitPrm := morphsubnet.InitPrm{}
subnetInitPrm.SetBaseClient(s.morphClient)
subnetInitPrm.SetContractAddress(s.contracts.subnet)
subnetInitPrm.SetMode(clientMode)
subnetClient := &morphsubnet.Client{}
err := subnetClient.Init(subnetInitPrm)
if err != nil {
return nil, fmt.Errorf("could not initialize subnet client: %w", err)
}
return subnetClient, nil
}
func (s *Server) initAlphabetProcessor(cfg *viper.Viper) (*alphabet.Processor, error) {
parsedWallets, err := parseWalletAddressesFromStrings(cfg.GetStringSlice("emit.extra_wallets"))
if err != nil {
@ -400,7 +369,7 @@ func (s *Server) initAlphabetProcessor(cfg *viper.Viper) (*alphabet.Processor, e
}
func (s *Server) initContainerProcessor(cfg *viper.Viper, cnrClient *container.Client,
frostfsIDClient *frostfsid.Client, subnetClient *morphsubnet.Client) error {
frostfsIDClient *frostfsid.Client) error {
// container processor
containerProcessor, err := cont.New(&cont.Params{
Log: s.log,
@ -410,7 +379,6 @@ func (s *Server) initContainerProcessor(cfg *viper.Viper, cnrClient *container.C
FrostFSIDClient: frostfsIDClient,
NetworkState: s.netmapClient,
NotaryDisabled: s.sideNotaryConfig.disabled,
SubnetClient: subnetClient,
})
if err != nil {
return err
@ -515,10 +483,9 @@ func (s *Server) initGRPCServer(cfg *viper.Viper) error {
}
type serverMorphClients struct {
CnrClient *container.Client
FrostFSIDClient *frostfsid.Client
FrostFSClient *frostfsClient.Client
MorphSubnetClient *morphsubnet.Client
CnrClient *container.Client
FrostFSIDClient *frostfsid.Client
FrostFSClient *frostfsClient.Client
}
func (s *Server) initClientsFromMorph() (*serverMorphClients, error) {
@ -574,11 +541,6 @@ func (s *Server) initClientsFromMorph() (*serverMorphClients, error) {
return nil, err
}
result.MorphSubnetClient, err = s.createMorphSubnetClient()
if err != nil {
return nil, err
}
return result, nil
}
@ -624,12 +586,12 @@ func (s *Server) initProcessors(cfg *viper.Viper, morphClients *serverMorphClien
return nil, err
}
err = s.initNetmapProcessor(cfg, morphClients.CnrClient, alphaSync, morphClients.MorphSubnetClient, auditProcessor, result.SettlementProcessor)
err = s.initNetmapProcessor(cfg, morphClients.CnrClient, alphaSync, auditProcessor, result.SettlementProcessor)
if err != nil {
return nil, err
}
err = s.initContainerProcessor(cfg, morphClients.CnrClient, morphClients.FrostFSIDClient, morphClients.MorphSubnetClient)
err = s.initContainerProcessor(cfg, morphClients.CnrClient, morphClients.FrostFSIDClient)
if err != nil {
return nil, err
}