Skip to content

Commit

Permalink
Try to fix bug in StartNewOCRRound()
Browse files Browse the repository at this point in the history
It calls WaitForEvents(), but I'm not sure whether that might just be
waiting for the next block header.Calling ocrContract.Wait() explicitly
to make sure it waits for the round to be fully completed and confirmed
  • Loading branch information
reductionista committed Dec 21, 2023
1 parent 66fe7e7 commit 19c20b3
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions integration-tests/actions/ocr2_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (

"github.com/smartcontractkit/chainlink-testing-framework/blockchain"
ctfClient "github.com/smartcontractkit/chainlink-testing-framework/client"

"github.com/smartcontractkit/chainlink/v2/core/services/job"
"github.com/smartcontractkit/chainlink/v2/core/services/keystore/chaintype"
"github.com/smartcontractkit/chainlink/v2/core/services/ocr2/testhelpers"
Expand Down Expand Up @@ -383,9 +384,16 @@ func StartNewOCR2Round(
}
ocrRound := contracts.NewOffchainAggregatorV2RoundConfirmer(ocrInstances[i], big.NewInt(roundNumber), timeout, logger)
client.AddHeaderEventSubscription(ocrInstances[i].Address(), ocrRound)
err = client.WaitForEvents()
//err = client.WaitForEvents()
//if err != nil {
// return fmt.Errorf("failed to wait for event subscriptions of OCR instance %d: %w", i+1, err)
//}
err = ocrRound.Wait() // wait for OCR Round to complete
if err != nil {
return fmt.Errorf("failed to wait for event subscriptions of OCR instance %d: %w", i+1, err)
return fmt.Errorf("failed to wait for OCR Round %d to complete", roundNumber, i)
}
if !ocrRound.Complete() {
return fmt.Errorf("failed to complete OCR Round %d for ocr instance %d", roundNumber, i)
}
}
return nil
Expand Down

0 comments on commit 19c20b3

Please sign in to comment.