Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: move schedule interval calculation out of the loop (release v20) #2856

Merged
merged 3 commits into from
Sep 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions zetaclient/orchestrator/orchestrator.go
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,9 @@
// #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 457 in zetaclient/orchestrator/orchestrator.go

View check run for this annotation

Codecov / codecov/patch

zetaclient/orchestrator/orchestrator.go#L456-L457

Added lines #L456 - L457 were not covered by tests

for idx, cctx := range cctxList {
params := cctx.GetCurrentOutboundParam()
nonce := params.TssNonce
Expand Down Expand Up @@ -486,8 +489,6 @@
// 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
Loading