From cc35c7cea3bcc37e8638c0834d4e184d126e0094 Mon Sep 17 00:00:00 2001 From: brewmaster012 <88689859+brewmaster012@users.noreply.github.com> Date: Fri, 6 Sep 2024 11:17:04 -0500 Subject: [PATCH] move interval assignment out of cctx loop: those things should not mutate in the loop. As it was before they could mutate because outboundScheduleInterval could change. --- zetaclient/orchestrator/orchestrator.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zetaclient/orchestrator/orchestrator.go b/zetaclient/orchestrator/orchestrator.go index a44f7e80c3..6b2b673f4e 100644 --- a/zetaclient/orchestrator/orchestrator.go +++ b/zetaclient/orchestrator/orchestrator.go @@ -452,6 +452,8 @@ func (oc *Orchestrator) ScheduleCctxEVM( outboundScheduleLookback := uint64(float64(outboundScheduleLookahead) * evmOutboundLookbackFactor) // #nosec G115 positive outboundScheduleInterval := uint64(observer.GetChainParams().OutboundScheduleInterval) + criticalInterval := uint64(10) // for critical pending outbound we reduce re-try interval + nonCriticalInterval := outboundScheduleInterval * 2 // for non-critical pending outbound we increase re-try interval for idx, cctx := range cctxList { params := cctx.GetCurrentOutboundParam() @@ -486,8 +488,6 @@ func (oc *Orchestrator) ScheduleCctxEVM( // determining critical outbound; if it satisfies following criteria // 1. it's the first pending outbound for this chain // 2. the following 5 nonces have been in tracker - criticalInterval := uint64(10) // for critical pending outbound we reduce re-try interval - nonCriticalInterval := outboundScheduleInterval * 2 // for non-critical pending outbound we increase re-try interval if nonce%criticalInterval == zetaHeight%criticalInterval { count := 0 for i := nonce + 1; i <= nonce+10; i++ {