forked from TrueCloudLab/frostfs-node
[#21] ir: Remove excess todo
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
parent
4aee3de24e
commit
f23d8a5f4a
7 changed files with 28 additions and 28 deletions
|
@ -89,6 +89,6 @@ func LockAsset(cli *client.Client, con util.Uint160, p *LockParams) error {
|
||||||
p.User.BytesBE(),
|
p.User.BytesBE(),
|
||||||
p.LockAccount.BytesBE(),
|
p.LockAccount.BytesBE(),
|
||||||
p.Amount,
|
p.Amount,
|
||||||
int64(p.Until), // fixme: invoke can work only with int64 values
|
int64(p.Until),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func (bp *Processor) handleLock(ev event.Event) {
|
func (bp *Processor) handleLock(ev event.Event) {
|
||||||
lock := ev.(balanceEvent.Lock) // todo: check panic in production
|
lock := ev.(balanceEvent.Lock)
|
||||||
bp.log.Info("notification",
|
bp.log.Info("notification",
|
||||||
zap.String("type", "lock"),
|
zap.String("type", "lock"),
|
||||||
zap.String("value", hex.EncodeToString(lock.ID())))
|
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) })
|
err := bp.pool.Submit(func() { bp.processLock(&lock) })
|
||||||
if err != nil {
|
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",
|
bp.log.Warn("balance worker pool drained",
|
||||||
zap.Int("capacity", bp.pool.Cap()))
|
zap.Int("capacity", bp.pool.Cap()))
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,7 +17,7 @@ func (bp *Processor) processLock(lock *balanceEvent.Lock) {
|
||||||
err := invoke.CashOutCheque(bp.mainnetClient, bp.neofsContract,
|
err := invoke.CashOutCheque(bp.mainnetClient, bp.neofsContract,
|
||||||
&invoke.ChequeParams{
|
&invoke.ChequeParams{
|
||||||
ID: lock.ID(),
|
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(),
|
User: lock.User(),
|
||||||
LockAccount: lock.LockAccount(),
|
LockAccount: lock.LockAccount(),
|
||||||
})
|
})
|
||||||
|
|
|
@ -10,7 +10,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func (cp *Processor) handlePut(ev event.Event) {
|
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())
|
id := sha256.Sum256(put.Container())
|
||||||
cp.log.Info("notification",
|
cp.log.Info("notification",
|
||||||
|
@ -21,14 +21,14 @@ func (cp *Processor) handlePut(ev event.Event) {
|
||||||
|
|
||||||
err := cp.pool.Submit(func() { cp.processContainerPut(&put) })
|
err := cp.pool.Submit(func() { cp.processContainerPut(&put) })
|
||||||
if err != nil {
|
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",
|
cp.log.Warn("container processor worker pool drained",
|
||||||
zap.Int("capacity", cp.pool.Cap()))
|
zap.Int("capacity", cp.pool.Cap()))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (cp *Processor) handleDelete(ev event.Event) {
|
func (cp *Processor) handleDelete(ev event.Event) {
|
||||||
del := ev.(containerEvent.Delete) // todo: check panic in production
|
del := ev.(containerEvent.Delete)
|
||||||
cp.log.Info("notification",
|
cp.log.Info("notification",
|
||||||
zap.String("type", "container delete"),
|
zap.String("type", "container delete"),
|
||||||
zap.String("id", base58.Encode(del.ContainerID())))
|
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) })
|
err := cp.pool.Submit(func() { cp.processContainerDelete(&del) })
|
||||||
if err != nil {
|
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",
|
cp.log.Warn("container processor worker pool drained",
|
||||||
zap.Int("capacity", cp.pool.Cap()))
|
zap.Int("capacity", cp.pool.Cap()))
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func (np *Processor) handleDeposit(ev event.Event) {
|
func (np *Processor) handleDeposit(ev event.Event) {
|
||||||
deposit := ev.(neofsEvent.Deposit) // todo: check panic in production
|
deposit := ev.(neofsEvent.Deposit)
|
||||||
np.log.Info("notification",
|
np.log.Info("notification",
|
||||||
zap.String("type", "deposit"),
|
zap.String("type", "deposit"),
|
||||||
zap.String("id", hex.EncodeToString(deposit.ID())))
|
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) })
|
err := np.pool.Submit(func() { np.processDeposit(&deposit) })
|
||||||
if err != nil {
|
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",
|
np.log.Warn("neofs processor worker pool drained",
|
||||||
zap.Int("capacity", np.pool.Cap()))
|
zap.Int("capacity", np.pool.Cap()))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (np *Processor) handleWithdraw(ev event.Event) {
|
func (np *Processor) handleWithdraw(ev event.Event) {
|
||||||
withdraw := ev.(neofsEvent.Withdraw) // todo: check panic in production
|
withdraw := ev.(neofsEvent.Withdraw)
|
||||||
np.log.Info("notification",
|
np.log.Info("notification",
|
||||||
zap.String("type", "withdraw"),
|
zap.String("type", "withdraw"),
|
||||||
zap.String("id", hex.EncodeToString(withdraw.ID())))
|
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) })
|
err := np.pool.Submit(func() { np.processWithdraw(&withdraw) })
|
||||||
if err != nil {
|
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",
|
np.log.Warn("neofs processor worker pool drained",
|
||||||
zap.Int("capacity", np.pool.Cap()))
|
zap.Int("capacity", np.pool.Cap()))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (np *Processor) handleCheque(ev event.Event) {
|
func (np *Processor) handleCheque(ev event.Event) {
|
||||||
cheque := ev.(neofsEvent.Cheque) // todo: check panic in production
|
cheque := ev.(neofsEvent.Cheque)
|
||||||
np.log.Info("notification",
|
np.log.Info("notification",
|
||||||
zap.String("type", "cheque"),
|
zap.String("type", "cheque"),
|
||||||
zap.String("id", hex.EncodeToString(cheque.ID())))
|
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) })
|
err := np.pool.Submit(func() { np.processCheque(&cheque) })
|
||||||
if err != nil {
|
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",
|
np.log.Warn("neofs processor worker pool drained",
|
||||||
zap.Int("capacity", np.pool.Cap()))
|
zap.Int("capacity", np.pool.Cap()))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (np *Processor) handleConfig(ev event.Event) {
|
func (np *Processor) handleConfig(ev event.Event) {
|
||||||
cfg := ev.(neofsEvent.Config) // todo: check panic in production
|
cfg := ev.(neofsEvent.Config)
|
||||||
np.log.Info("notification",
|
np.log.Info("notification",
|
||||||
zap.String("type", "set config"),
|
zap.String("type", "set config"),
|
||||||
zap.String("key", hex.EncodeToString(cfg.Key())),
|
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) })
|
err := np.pool.Submit(func() { np.processConfig(&cfg) })
|
||||||
if err != nil {
|
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",
|
np.log.Warn("neofs processor worker pool drained",
|
||||||
zap.Int("capacity", np.pool.Cap()))
|
zap.Int("capacity", np.pool.Cap()))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (np *Processor) handleUpdateInnerRing(ev event.Event) {
|
func (np *Processor) handleUpdateInnerRing(ev event.Event) {
|
||||||
updIR := ev.(neofsEvent.UpdateInnerRing) // todo: check panic in production
|
updIR := ev.(neofsEvent.UpdateInnerRing)
|
||||||
np.log.Info("notification",
|
np.log.Info("notification",
|
||||||
zap.String("type", "update inner ring"),
|
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) })
|
err := np.pool.Submit(func() { np.processUpdateInnerRing(&updIR) })
|
||||||
if err != nil {
|
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",
|
np.log.Warn("neofs processor worker pool drained",
|
||||||
zap.Int("capacity", np.pool.Cap()))
|
zap.Int("capacity", np.pool.Cap()))
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,7 +55,7 @@ func (np *Processor) processWithdraw(withdraw *neofsEvent.Withdraw) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// create lock account
|
// 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])
|
lock, err := util.Uint160DecodeBytesBE(withdraw.ID()[:util.Uint160Size])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
np.log.Error("can't create lock account", zap.Error(err))
|
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(),
|
ID: withdraw.ID(),
|
||||||
User: withdraw.User(),
|
User: withdraw.User(),
|
||||||
LockAccount: lock,
|
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,
|
Until: curEpoch + lockAccountLifetime,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
@ -10,21 +10,21 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func (np *Processor) handleNewEpochTick(ev event.Event) {
|
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"))
|
np.log.Info("tick", zap.String("type", "epoch"))
|
||||||
|
|
||||||
// send event to the worker pool
|
// send event to the worker pool
|
||||||
|
|
||||||
err := np.pool.Submit(func() { np.processNewEpochTick() })
|
err := np.pool.Submit(func() { np.processNewEpochTick() })
|
||||||
if err != nil {
|
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",
|
np.log.Warn("netmap worker pool drained",
|
||||||
zap.Int("capacity", np.pool.Cap()))
|
zap.Int("capacity", np.pool.Cap()))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (np *Processor) handleNewEpoch(ev event.Event) {
|
func (np *Processor) handleNewEpoch(ev event.Event) {
|
||||||
epochEvent := ev.(netmapEvent.NewEpoch) // todo: check panic in production
|
epochEvent := ev.(netmapEvent.NewEpoch)
|
||||||
np.log.Info("notification",
|
np.log.Info("notification",
|
||||||
zap.String("type", "new epoch"),
|
zap.String("type", "new epoch"),
|
||||||
zap.Uint64("value", epochEvent.EpochNumber()))
|
zap.Uint64("value", epochEvent.EpochNumber()))
|
||||||
|
@ -35,14 +35,14 @@ func (np *Processor) handleNewEpoch(ev event.Event) {
|
||||||
np.processNewEpoch(epochEvent.EpochNumber())
|
np.processNewEpoch(epochEvent.EpochNumber())
|
||||||
})
|
})
|
||||||
if err != nil {
|
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",
|
np.log.Warn("netmap worker pool drained",
|
||||||
zap.Int("capacity", np.pool.Cap()))
|
zap.Int("capacity", np.pool.Cap()))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (np *Processor) handleAddPeer(ev event.Event) {
|
func (np *Processor) handleAddPeer(ev event.Event) {
|
||||||
newPeer := ev.(netmapEvent.AddPeer) // todo: check panic in production
|
newPeer := ev.(netmapEvent.AddPeer)
|
||||||
|
|
||||||
np.log.Info("notification",
|
np.log.Info("notification",
|
||||||
zap.String("type", "add peer"),
|
zap.String("type", "add peer"),
|
||||||
|
@ -54,14 +54,14 @@ func (np *Processor) handleAddPeer(ev event.Event) {
|
||||||
np.processAddPeer(newPeer.Node())
|
np.processAddPeer(newPeer.Node())
|
||||||
})
|
})
|
||||||
if err != nil {
|
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",
|
np.log.Warn("netmap worker pool drained",
|
||||||
zap.Int("capacity", np.pool.Cap()))
|
zap.Int("capacity", np.pool.Cap()))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (np *Processor) handleUpdateState(ev event.Event) {
|
func (np *Processor) handleUpdateState(ev event.Event) {
|
||||||
updPeer := ev.(netmapEvent.UpdatePeer) // todo: check panic in production
|
updPeer := ev.(netmapEvent.UpdatePeer)
|
||||||
np.log.Info("notification",
|
np.log.Info("notification",
|
||||||
zap.String("type", "update peer state"),
|
zap.String("type", "update peer state"),
|
||||||
zap.String("key", hex.EncodeToString(updPeer.PublicKey().Bytes())))
|
zap.String("key", hex.EncodeToString(updPeer.PublicKey().Bytes())))
|
||||||
|
@ -72,7 +72,7 @@ func (np *Processor) handleUpdateState(ev event.Event) {
|
||||||
np.processUpdatePeer(updPeer)
|
np.processUpdatePeer(updPeer)
|
||||||
})
|
})
|
||||||
if err != nil {
|
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",
|
np.log.Warn("netmap worker pool drained",
|
||||||
zap.Int("capacity", np.pool.Cap()))
|
zap.Int("capacity", np.pool.Cap()))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue