Skip to content

Commit

Permalink
added delay between transaction to fix non contiguous event nonce whe…
Browse files Browse the repository at this point in the history
…n syncing after long time
  • Loading branch information
mankenavenkatesh committed Jun 29, 2021
1 parent 717cdae commit 94d0f48
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions orchestrator/cosmos/broadcast.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package cosmos
import (
"context"
"fmt"
"time"

sdk "github.com/cosmos/cosmos-sdk/types"
ethcmn "github.com/ethereum/go-ethereum/common"
Expand Down Expand Up @@ -354,6 +355,7 @@ func (s *peggyBroadcastClient) SendEthereumClaims(
// Individual arrays (deposits, withdraws, valsetUpdates) are sorted.
// Broadcast claim events sequentially starting with eventNonce = lastClaimEvent + 1.
for count < totalClaimEvents {
time.Sleep(100 * time.Millisecond)
if i < len(deposits) && deposits[i].EventNonce.Uint64() == lastClaimEvent+1 {
// send deposit
if err := s.sendDepositClaims(ctx, deposits[i]); err != nil {
Expand Down
2 changes: 1 addition & 1 deletion orchestrator/main_loops.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
ethcmn "github.com/ethereum/go-ethereum/common"
)

const defaultLoopDur = 30 * time.Second
const defaultLoopDur = 60 * time.Second

// Start combines the all major roles required to make
// up the Orchestrator, all of these are async loops.
Expand Down

0 comments on commit 94d0f48

Please sign in to comment.