Skip to content

Commit

Permalink
fix: move interval assignment out of cctx loop (#2843)
Browse files Browse the repository at this point in the history
* move interval assignment out of cctx loop

* changelog

---------

Co-authored-by: brewmaster012 <[email protected]>
  • Loading branch information
skosito and brewmaster012 authored Sep 6, 2024
1 parent cce07f1 commit 4d7f2ba
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
6 changes: 6 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# CHANGELOG

## v19.1.4

### Fixes

* [2843](https://github.com/zeta-chain/node/pull/2843) - move interval assignment out of cctx loop

## v19.1.3

### Fixes
Expand Down
12 changes: 5 additions & 7 deletions zetaclient/orchestrator/orchestrator.go
Original file line number Diff line number Diff line change
Expand Up @@ -449,8 +449,11 @@ func (oc *Orchestrator) ScheduleCctxEVM(
outboundScheduleLookback := uint64(float64(outboundScheduleLookahead) * evmOutboundLookbackFactor)
// #nosec G115 positive
outboundScheduleInterval := uint64(observer.GetChainParams().OutboundScheduleInterval)
oc.logger.Info().
Msgf("outboundScheduleInterval set to %d from params %d", outboundScheduleInterval, observer.GetChainParams().OutboundScheduleInterval)
// 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

for idx, cctx := range cctxList {
params := cctx.GetCurrentOutboundParam()
Expand Down Expand Up @@ -482,11 +485,6 @@ func (oc *Orchestrator) ScheduleCctxEVM(
continue
}

// 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 4d7f2ba

Please sign in to comment.