From ba58a77f8c1da500ba28cb7bf5d5db295f4d44a9 Mon Sep 17 00:00:00 2001
From: Pavel Karpy
Date: Tue, 28 Mar 2023 18:46:25 +0300
Subject: [PATCH] [#184] node, ir: Do not wait for already made notary deposits
Signed-off-by: Pavel Karpy
---
cmd/frostfs-node/morph.go | 8 ++++++++
pkg/innerring/notary.go | 8 ++++++++
2 files changed, 16 insertions(+)
diff --git a/cmd/frostfs-node/morph.go b/cmd/frostfs-node/morph.go
index 6c09ae02..4ab2eaca 100644
--- a/cmd/frostfs-node/morph.go
+++ b/cmd/frostfs-node/morph.go
@@ -117,6 +117,14 @@ func makeAndWaitNotaryDeposit(c *cfg) {
tx, err := makeNotaryDeposit(c)
fatalOnErr(err)
+ if tx.Equals(util.Uint256{}) {
+ // non-error deposit with an empty TX hash means
+ // that the deposit has already been made; no
+ // need to wait it.
+ c.log.Info("notary deposit has already been made")
+ return
+ }
+
err = waitNotaryDeposit(c, tx)
fatalOnErr(err)
}
diff --git a/pkg/innerring/notary.go b/pkg/innerring/notary.go
index 0567857c..617d7bbe 100644
--- a/pkg/innerring/notary.go
+++ b/pkg/innerring/notary.go
@@ -79,6 +79,14 @@ func (s *Server) initNotary(ctx context.Context, deposit depositor, await awaite
return err
}
+ if tx.Equals(util.Uint256{}) {
+ // non-error deposit with an empty TX hash means
+ // that the deposit has already been made; no
+ // need to wait it.
+ s.log.Info("notary deposit has already been made")
+ return nil
+ }
+
s.log.Info(msg)
return await(ctx, tx)