node/pkg/processor: increase timeout for observed VAAs to 24 hours

In cases where we observed a VAA, there is no possibility of gossip DoS.
Increase the timeout to 24 hours to facilitate manual interventions
(like submission of governance VAAs or node restarts/catchup).

Keep the existing five minute timeout for observation-less VAAs.

Change-Id: Ic626108190bd60cf812daadbe191b31cc48c7296
This commit is contained in:
Leo 2021-09-30 19:52:53 +02:00 committed by Leopold Schabel
parent 20ce9e1e5c
commit 7998d04554
1 changed files with 2 additions and 2 deletions

View File

@ -82,7 +82,7 @@ func (p *Processor) handleCleanup(ctx context.Context) {
p.logger.Info("expiring submitted VAA", zap.String("digest", hash), zap.Duration("delta", delta)) p.logger.Info("expiring submitted VAA", zap.String("digest", hash), zap.Duration("delta", delta))
delete(p.state.vaaSignatures, hash) delete(p.state.vaaSignatures, hash)
aggregationStateExpiration.Inc() aggregationStateExpiration.Inc()
case !s.submitted && s.retryCount >= 10: case !s.submitted && ((s.ourMsg != nil && s.retryCount >= 2880 /* 24 hours */) || (s.ourMsg == nil && s.retryCount >= 10 /* 5 minutes */)):
// Clearly, this horse is dead and continued beatings won't bring it closer to quorum. // Clearly, this horse is dead and continued beatings won't bring it closer to quorum.
p.logger.Info("expiring unsubmitted VAA after exhausting retries", zap.String("digest", hash), zap.Duration("delta", delta)) p.logger.Info("expiring unsubmitted VAA after exhausting retries", zap.String("digest", hash), zap.Duration("delta", delta))
delete(p.state.vaaSignatures, hash) delete(p.state.vaaSignatures, hash)
@ -97,7 +97,7 @@ func (p *Processor) handleCleanup(ctx context.Context) {
p.logger.Info("resubmitting VAA observation", p.logger.Info("resubmitting VAA observation",
zap.String("digest", hash), zap.String("digest", hash),
zap.Duration("delta", delta), zap.Duration("delta", delta),
zap.Int("retry", 1)) zap.Uint("retry", s.retryCount))
p.sendC <- s.ourMsg p.sendC <- s.ourMsg
s.retryCount += 1 s.retryCount += 1
aggregationStateRetries.Inc() aggregationStateRetries.Inc()