Skip to content
This repository was archived by the owner on May 22, 2023. It is now read-only.

Commit 40fc48b

Browse files
committed
Public key and signature submission monitoring made less aggresive
We were checking whether public key has been submitted every 10 minutes at maximum 3 times. This check was too aggressive because in some cases public key transactions could still be mined. We make the monitoring less aggressive to save on gas - check is performed every hour, at maximum 2 times. Similarly, signature submission monitoring has been made less aggressive and check is performed every 30 minutes instead of being performed every 10 minutes. In this case it also could happen that all transactions were still getting mined and resubmitting them had no sense.
1 parent f240e81 commit 40fc48b

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

pkg/node/node.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,7 @@ func (n *Node) waitForSignature(
499499
keepAddress common.Address,
500500
digest [32]byte,
501501
) bool {
502-
const waitTimeout = 10 * time.Minute
502+
const waitTimeout = 30 * time.Minute
503503
const checkTick = 1 * time.Minute
504504

505505
ctx, cancelCtx := context.WithTimeout(context.Background(), waitTimeout)
@@ -516,7 +516,7 @@ func (n *Node) waitForSignature(
516516
for {
517517
select {
518518
case <-checkTicker.C:
519-
// We check the public key periodically instead of relying on
519+
// We check the signature periodically instead of relying on
520520
// incoming events. The main motivation is that events could not be
521521
// trusted here because they may come from a forked chain or
522522
// the same event can be delivered multiple times.
@@ -663,11 +663,11 @@ func (n *Node) monitorKeepPublicKeySubmission(
663663
// not that serious as for not submitting a signature and to minimize gas
664664
// expenditure in case the current client's pub key has been properly
665665
// registered and we are waiting for someone else, we retry only three times.
666-
const maxPubkeyChecksCount = 3
666+
const maxPubkeyChecksCount = 2
667667
// All three operators need to submit public key to the chain so we are
668668
// less aggressive with check ticks than in case of signature submission
669669
// where only one signature is enough.
670-
const pubkeyCheckTick = 10 * time.Minute
670+
const pubkeyCheckTick = 60 * time.Minute
671671

672672
pubkeyCheckTicker := time.NewTicker(pubkeyCheckTick)
673673
defer pubkeyCheckTicker.Stop()

0 commit comments

Comments
 (0)