Skip to content

Commit

Permalink
fix: prevent division by 0 in ScheduleCctxEVM (#2840)
Browse files Browse the repository at this point in the history
* fix 0 division

* changelog
  • Loading branch information
lumtis authored Sep 6, 2024
1 parent d85e61f commit 0adef4b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
10 changes: 10 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# CHANGELOG

## v19.1.2

### Fixes

* [2840](https://github.com/zeta-chain/node/pull/2840) - prevent division by 0 in ScheduleCctxEVM

## v19.1.1

Fix release CI build

## v19.1.0

* [2524](https://github.com/zeta-chain/node/pull/2524) - add inscription envolop parsing
Expand Down
9 changes: 9 additions & 0 deletions zetaclient/orchestrator/orchestrator.go
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,15 @@ func (oc *Orchestrator) ScheduleCctxEVM(
outboundScheduleInterval = nonCriticalInterval
}

if outboundScheduleInterval == 0 {
// TODO: clean up this log when issue is resolved
// logging observer chain params to help with debugging if issue happens again
oc.logger.Error().
Interface("observer.chain_params", observer.GetChainParams()).
Msgf("ScheduleCctxEVM: outboundScheduleInterval set to 0 for chain %d", chainID)
return
}

// otherwise, the normal interval is used
if nonce%outboundScheduleInterval == zetaHeight%outboundScheduleInterval &&
!oc.outboundProc.IsOutboundActive(outboundID) {
Expand Down

0 comments on commit 0adef4b

Please sign in to comment.