[#486] innerring: Use fee provider and notary disabled flag in processors
Processors that use `invoke` package to make chain invocation should provide fee config and client with enabled or disabled notary support. If notary support is disabled, then functions from `invoke` package will perform ordinary method invocation with extra fee. Processors that use `morph/client` wrappers should check `notaryDisabled` flag to call corresponding wrapper function. Netmap processor omits some actions during validator syncronization if notary is disabled. Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
parent
91a1896b8b
commit
f2562e8c47
16 changed files with 111 additions and 38 deletions
|
@ -6,6 +6,7 @@ import (
|
|||
lru "github.com/hashicorp/golang-lru"
|
||||
"github.com/nspcc-dev/neo-go/pkg/encoding/fixedn"
|
||||
"github.com/nspcc-dev/neo-go/pkg/util"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/innerring/config"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/morph/client"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/morph/event"
|
||||
neofsEvent "github.com/nspcc-dev/neofs-node/pkg/morph/event/neofs"
|
||||
|
@ -41,6 +42,7 @@ type (
|
|||
epochState EpochState
|
||||
alphabetState AlphabetState
|
||||
converter PrecisionConverter
|
||||
feeProvider *config.FeeConfig
|
||||
mintEmitLock *sync.Mutex
|
||||
mintEmitCache *lru.Cache
|
||||
mintEmitThreshold uint64
|
||||
|
@ -59,6 +61,7 @@ type (
|
|||
EpochState EpochState
|
||||
AlphabetState AlphabetState
|
||||
Converter PrecisionConverter
|
||||
FeeProvider *config.FeeConfig
|
||||
MintEmitCacheSize int
|
||||
MintEmitThreshold uint64 // in epochs
|
||||
MintEmitValue fixedn.Fixed8
|
||||
|
@ -86,6 +89,8 @@ func New(p *Params) (*Processor, error) {
|
|||
return nil, errors.New("ir/neofs: global state is not set")
|
||||
case p.Converter == nil:
|
||||
return nil, errors.New("ir/neofs: balance precision converter is not set")
|
||||
case p.FeeProvider == nil:
|
||||
return nil, errors.New("ir/neofs: fee provider is not set")
|
||||
}
|
||||
|
||||
p.Log.Debug("neofs worker pool", zap.Int("size", p.PoolSize))
|
||||
|
@ -110,6 +115,7 @@ func New(p *Params) (*Processor, error) {
|
|||
epochState: p.EpochState,
|
||||
alphabetState: p.AlphabetState,
|
||||
converter: p.Converter,
|
||||
feeProvider: p.FeeProvider,
|
||||
mintEmitLock: new(sync.Mutex),
|
||||
mintEmitCache: lruCache,
|
||||
mintEmitThreshold: p.MintEmitThreshold,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue