Skip to content

Commit

Permalink
fix: move interval assignment out of cctx loop (#2842)
Browse files Browse the repository at this point in the history
* 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.

* update changelog
  • Loading branch information
brewmaster012 committed Sep 10, 2024
1 parent f8f65f9 commit 9df6938
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
* [2674](https://github.com/zeta-chain/node/pull/2674) - allow operators to vote on ballots associated with discarded keygen without affecting the status of the current keygen.
* [2672](https://github.com/zeta-chain/node/pull/2672) - check observer set for duplicates when adding a new observer or updating an existing one
* [2787](https://github.com/zeta-chain/node/pull/2787) - ask for 3 accounts (signer, pda, system_program) on solana gateway deposit
* [2842](https://github.com/zeta-chain/node/pull/2842) - fix: move interval assignment out of cctx loop in EVM outbound tx scheduler

## v19.0.0

Expand Down
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

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 9df6938

Please sign in to comment.