Skip to content

Commit

Permalink
move interval assignment out of cctx loop:
Browse files Browse the repository at this point in the history
those things should not mutate in the loop. As it was before
they could mutate because outboundScheduleInterval could change.
  • Loading branch information
brewmaster012 committed Sep 6, 2024
1 parent ba3b1c0 commit cc35c7c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions zetaclient/orchestrator/orchestrator.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Check warning on line 456 in zetaclient/orchestrator/orchestrator.go

View check run for this annotation

Codecov / codecov/patch

zetaclient/orchestrator/orchestrator.go#L455-L456

Added lines #L455 - L456 were not covered by tests

for idx, cctx := range cctxList {
params := cctx.GetCurrentOutboundParam()
Expand Down Expand Up @@ -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++ {
Expand Down

0 comments on commit cc35c7c

Please sign in to comment.