diff --git a/pkg/innerring/invoke/balance.go b/pkg/innerring/invoke/balance.go index 41465a83..ef3a349f 100644 --- a/pkg/innerring/invoke/balance.go +++ b/pkg/innerring/invoke/balance.go @@ -89,6 +89,6 @@ func LockAsset(cli *client.Client, con util.Uint160, p *LockParams) error { p.User.BytesBE(), p.LockAccount.BytesBE(), p.Amount, - int64(p.Until), // fixme: invoke can work only with int64 values + int64(p.Until), ) } diff --git a/pkg/innerring/processors/balance/handlers.go b/pkg/innerring/processors/balance/handlers.go index 8aa8ed9d..9403a5b8 100644 --- a/pkg/innerring/processors/balance/handlers.go +++ b/pkg/innerring/processors/balance/handlers.go @@ -9,7 +9,7 @@ import ( ) func (bp *Processor) handleLock(ev event.Event) { - lock := ev.(balanceEvent.Lock) // todo: check panic in production + lock := ev.(balanceEvent.Lock) bp.log.Info("notification", zap.String("type", "lock"), zap.String("value", hex.EncodeToString(lock.ID()))) @@ -18,7 +18,7 @@ func (bp *Processor) handleLock(ev event.Event) { err := bp.pool.Submit(func() { bp.processLock(&lock) }) if err != nil { - // todo: move into controlled degradation stage + // there system can be moved into controlled degradation stage bp.log.Warn("balance worker pool drained", zap.Int("capacity", bp.pool.Cap())) } diff --git a/pkg/innerring/processors/balance/process_assets.go b/pkg/innerring/processors/balance/process_assets.go index acb18039..dc5a125d 100644 --- a/pkg/innerring/processors/balance/process_assets.go +++ b/pkg/innerring/processors/balance/process_assets.go @@ -17,7 +17,7 @@ func (bp *Processor) processLock(lock *balanceEvent.Lock) { err := invoke.CashOutCheque(bp.mainnetClient, bp.neofsContract, &invoke.ChequeParams{ ID: lock.ID(), - Amount: lock.Amount() / 1_0000_0000, // todo: Fixed16 to Fixed8 + Amount: lock.Amount() / 1_0000_0000, // Fixed16 to Fixed8 User: lock.User(), LockAccount: lock.LockAccount(), }) diff --git a/pkg/innerring/processors/container/handlers.go b/pkg/innerring/processors/container/handlers.go index 9e62e266..a2944567 100644 --- a/pkg/innerring/processors/container/handlers.go +++ b/pkg/innerring/processors/container/handlers.go @@ -10,7 +10,7 @@ import ( ) func (cp *Processor) handlePut(ev event.Event) { - put := ev.(containerEvent.Put) // todo: check panic in production + put := ev.(containerEvent.Put) id := sha256.Sum256(put.Container()) cp.log.Info("notification", @@ -21,14 +21,14 @@ func (cp *Processor) handlePut(ev event.Event) { err := cp.pool.Submit(func() { cp.processContainerPut(&put) }) if err != nil { - // todo: move into controlled degradation stage + // there system can be moved into controlled degradation stage cp.log.Warn("container processor worker pool drained", zap.Int("capacity", cp.pool.Cap())) } } func (cp *Processor) handleDelete(ev event.Event) { - del := ev.(containerEvent.Delete) // todo: check panic in production + del := ev.(containerEvent.Delete) cp.log.Info("notification", zap.String("type", "container delete"), zap.String("id", base58.Encode(del.ContainerID()))) @@ -37,7 +37,7 @@ func (cp *Processor) handleDelete(ev event.Event) { err := cp.pool.Submit(func() { cp.processContainerDelete(&del) }) if err != nil { - // todo: move into controlled degradation stage + // there system can be moved into controlled degradation stage cp.log.Warn("container processor worker pool drained", zap.Int("capacity", cp.pool.Cap())) } diff --git a/pkg/innerring/processors/neofs/handlers.go b/pkg/innerring/processors/neofs/handlers.go index 487b02ca..deed8785 100644 --- a/pkg/innerring/processors/neofs/handlers.go +++ b/pkg/innerring/processors/neofs/handlers.go @@ -9,7 +9,7 @@ import ( ) func (np *Processor) handleDeposit(ev event.Event) { - deposit := ev.(neofsEvent.Deposit) // todo: check panic in production + deposit := ev.(neofsEvent.Deposit) np.log.Info("notification", zap.String("type", "deposit"), zap.String("id", hex.EncodeToString(deposit.ID()))) @@ -18,14 +18,14 @@ func (np *Processor) handleDeposit(ev event.Event) { err := np.pool.Submit(func() { np.processDeposit(&deposit) }) if err != nil { - // todo: move into controlled degradation stage + // there system can be moved into controlled degradation stage np.log.Warn("neofs processor worker pool drained", zap.Int("capacity", np.pool.Cap())) } } func (np *Processor) handleWithdraw(ev event.Event) { - withdraw := ev.(neofsEvent.Withdraw) // todo: check panic in production + withdraw := ev.(neofsEvent.Withdraw) np.log.Info("notification", zap.String("type", "withdraw"), zap.String("id", hex.EncodeToString(withdraw.ID()))) @@ -34,14 +34,14 @@ func (np *Processor) handleWithdraw(ev event.Event) { err := np.pool.Submit(func() { np.processWithdraw(&withdraw) }) if err != nil { - // todo: move into controlled degradation stage + // there system can be moved into controlled degradation stage np.log.Warn("neofs processor worker pool drained", zap.Int("capacity", np.pool.Cap())) } } func (np *Processor) handleCheque(ev event.Event) { - cheque := ev.(neofsEvent.Cheque) // todo: check panic in production + cheque := ev.(neofsEvent.Cheque) np.log.Info("notification", zap.String("type", "cheque"), zap.String("id", hex.EncodeToString(cheque.ID()))) @@ -50,14 +50,14 @@ func (np *Processor) handleCheque(ev event.Event) { err := np.pool.Submit(func() { np.processCheque(&cheque) }) if err != nil { - // todo: move into controlled degradation stage + // there system can be moved into controlled degradation stage np.log.Warn("neofs processor worker pool drained", zap.Int("capacity", np.pool.Cap())) } } func (np *Processor) handleConfig(ev event.Event) { - cfg := ev.(neofsEvent.Config) // todo: check panic in production + cfg := ev.(neofsEvent.Config) np.log.Info("notification", zap.String("type", "set config"), zap.String("key", hex.EncodeToString(cfg.Key())), @@ -67,14 +67,14 @@ func (np *Processor) handleConfig(ev event.Event) { err := np.pool.Submit(func() { np.processConfig(&cfg) }) if err != nil { - // todo: move into controlled degradation stage + // there system can be moved into controlled degradation stage np.log.Warn("neofs processor worker pool drained", zap.Int("capacity", np.pool.Cap())) } } func (np *Processor) handleUpdateInnerRing(ev event.Event) { - updIR := ev.(neofsEvent.UpdateInnerRing) // todo: check panic in production + updIR := ev.(neofsEvent.UpdateInnerRing) np.log.Info("notification", zap.String("type", "update inner ring"), ) @@ -83,7 +83,7 @@ func (np *Processor) handleUpdateInnerRing(ev event.Event) { err := np.pool.Submit(func() { np.processUpdateInnerRing(&updIR) }) if err != nil { - // todo: move into controlled degradation stage + // there system can be moved into controlled degradation stage np.log.Warn("neofs processor worker pool drained", zap.Int("capacity", np.pool.Cap())) } diff --git a/pkg/innerring/processors/neofs/process_assets.go b/pkg/innerring/processors/neofs/process_assets.go index 52e43da4..b35d6c7d 100644 --- a/pkg/innerring/processors/neofs/process_assets.go +++ b/pkg/innerring/processors/neofs/process_assets.go @@ -55,7 +55,7 @@ func (np *Processor) processWithdraw(withdraw *neofsEvent.Withdraw) { } // create lock account - // todo: check collision there, consider reversed script hash + // fixme: check collision there, consider reversed script hash lock, err := util.Uint160DecodeBytesBE(withdraw.ID()[:util.Uint160Size]) if err != nil { np.log.Error("can't create lock account", zap.Error(err)) @@ -69,7 +69,7 @@ func (np *Processor) processWithdraw(withdraw *neofsEvent.Withdraw) { ID: withdraw.ID(), User: withdraw.User(), LockAccount: lock, - Amount: withdraw.Amount() * 1_0000_0000, // todo: from Fixed8 to Fixed16 + Amount: withdraw.Amount() * 1_0000_0000, // from Fixed8 to Fixed16 Until: curEpoch + lockAccountLifetime, }) if err != nil { diff --git a/pkg/innerring/processors/netmap/handlers.go b/pkg/innerring/processors/netmap/handlers.go index 51aba5b9..bd0b1cde 100644 --- a/pkg/innerring/processors/netmap/handlers.go +++ b/pkg/innerring/processors/netmap/handlers.go @@ -10,21 +10,21 @@ import ( ) func (np *Processor) handleNewEpochTick(ev event.Event) { - _ = ev.(timerEvent.NewEpochTick) // todo: check panic in production + _ = ev.(timerEvent.NewEpochTick) np.log.Info("tick", zap.String("type", "epoch")) // send event to the worker pool err := np.pool.Submit(func() { np.processNewEpochTick() }) if err != nil { - // todo: move into controlled degradation stage + // there system can be moved into controlled degradation stage np.log.Warn("netmap worker pool drained", zap.Int("capacity", np.pool.Cap())) } } func (np *Processor) handleNewEpoch(ev event.Event) { - epochEvent := ev.(netmapEvent.NewEpoch) // todo: check panic in production + epochEvent := ev.(netmapEvent.NewEpoch) np.log.Info("notification", zap.String("type", "new epoch"), zap.Uint64("value", epochEvent.EpochNumber())) @@ -35,14 +35,14 @@ func (np *Processor) handleNewEpoch(ev event.Event) { np.processNewEpoch(epochEvent.EpochNumber()) }) if err != nil { - // todo: move into controlled degradation stage + // there system can be moved into controlled degradation stage np.log.Warn("netmap worker pool drained", zap.Int("capacity", np.pool.Cap())) } } func (np *Processor) handleAddPeer(ev event.Event) { - newPeer := ev.(netmapEvent.AddPeer) // todo: check panic in production + newPeer := ev.(netmapEvent.AddPeer) np.log.Info("notification", zap.String("type", "add peer"), @@ -54,14 +54,14 @@ func (np *Processor) handleAddPeer(ev event.Event) { np.processAddPeer(newPeer.Node()) }) if err != nil { - // todo: move into controlled degradation stage + // there system can be moved into controlled degradation stage np.log.Warn("netmap worker pool drained", zap.Int("capacity", np.pool.Cap())) } } func (np *Processor) handleUpdateState(ev event.Event) { - updPeer := ev.(netmapEvent.UpdatePeer) // todo: check panic in production + updPeer := ev.(netmapEvent.UpdatePeer) np.log.Info("notification", zap.String("type", "update peer state"), zap.String("key", hex.EncodeToString(updPeer.PublicKey().Bytes()))) @@ -72,7 +72,7 @@ func (np *Processor) handleUpdateState(ev event.Event) { np.processUpdatePeer(updPeer) }) if err != nil { - // todo: move into controlled degradation stage + // there system can be moved into controlled degradation stage np.log.Warn("netmap worker pool drained", zap.Int("capacity", np.pool.Cap())) }