Skip to content

Commit

Permalink
fix ci
Browse files Browse the repository at this point in the history
  • Loading branch information
gitferry committed Nov 26, 2024
1 parent 67b3e51 commit 2a21b69
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 35 deletions.
16 changes: 9 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@ on:

jobs:
lint_test:
uses: babylonlabs-io/.github/.github/workflows/reusable_go_lint_test.yml@v0.1.0
uses: babylonlabs-io/.github/.github/workflows/reusable_go_lint_test.yml@v0.7.0
secrets: inherit
with:
go-version: '1.23'
go-lint-version: 'v1.60.2'
run-unit-tests: true
run-lint: true

Expand All @@ -20,7 +22,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.22'
go-version: '1.23'
- name: Run e2e Babylon tests
run: make test-e2e-babylon

Expand All @@ -31,7 +33,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.22'
go-version: '1.23'
- name: Run e2e Wasmd tests
run: make test-e2e-wasmd

Expand All @@ -42,7 +44,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.22'
go-version: '1.23'
- name: Run e2e BCD tests
run: make test-e2e-bcd

Expand All @@ -53,14 +55,14 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.22'
go-version: '1.23'
- name: Set up the devnet data
run: make op-e2e-devnet
- name: Run e2e OP tests
run: make test-e2e-op

docker_pipeline:
uses: babylonlabs-io/.github/.github/workflows/reusable_docker_pipeline.yml@v0.1.0
uses: babylonlabs-io/.github/.github/workflows/reusable_docker_pipeline.yml@v0.7.0
secrets: inherit
with:
publish: false
14 changes: 8 additions & 6 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ on:

jobs:
lint_test:
uses: babylonlabs-io/.github/.github/workflows/reusable_go_lint_test.yml@v0.1.0
uses: babylonlabs-io/.github/.github/workflows/reusable_go_lint_test.yml@v0.7.0
with:
go-version: '1.23'
go-lint-version: 'v1.60.2'
run-unit-tests: true
run-lint: true

Expand All @@ -22,7 +24,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.22'
go-version: '1.23'
- name: Run e2e Babylon tests
run: make test-e2e-babylon

Expand All @@ -33,7 +35,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.22'
go-version: '1.23'
- name: Run e2e Wasmd tests
run: make test-e2e-wasmd

Expand All @@ -44,7 +46,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.22'
go-version: '1.23'
- name: Run e2e BCD tests
run: make test-e2e-bcd

Expand All @@ -55,15 +57,15 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.22'
go-version: '1.23'
- name: Set up the devnet data
run: make op-e2e-devnet
- name: Run e2e OP tests
run: make test-e2e-op

docker_pipeline:
needs: ["lint_test"]
uses: babylonlabs-io/.github/.github/workflows/reusable_docker_pipeline.yml@v0.1.0
uses: babylonlabs-io/.github/.github/workflows/reusable_docker_pipeline.yml@v0.7.0
secrets: inherit
with:
publish: true
43 changes: 21 additions & 22 deletions finality-provider/service/fp_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -430,35 +430,34 @@ func (fp *FinalityProviderInstance) retrySubmitSigsUntilFinalized(targetBlocks [
return nil, nil
}

failedCycles += 1
if failedCycles > uint32(fp.cfg.MaxSubmissionRetries) {
failedCycles++
if failedCycles > fp.cfg.MaxSubmissionRetries {
return nil, fmt.Errorf("reached max failed cycles with err: %w", err)
}
} else {
// the signature has been successfully submitted
return res, nil
}
select {
case <-time.After(fp.cfg.SubmissionRetryInterval):
// periodically query the index block to be later checked whether it is Finalized
finalized, err := fp.consumerCon.QueryIsBlockFinalized(targetHeight)
if err != nil {
return nil, fmt.Errorf("failed to query block finalization at height %v: %w", targetHeight, err)
}
if finalized {
fp.logger.Debug(
"the block is already finalized, skip submission",
zap.String("pk", fp.GetBtcPkHex()),
zap.Uint64("target_height", targetHeight),
)
// TODO: returning nil here is to safely break the loop
// the error still exists
return nil, nil
}
case <-fp.quit:
fp.logger.Debug("the finality-provider instance is closing", zap.String("pk", fp.GetBtcPkHex()))
return nil, ErrFinalityProviderShutDown

// periodically query the index block to be later checked whether it is Finalized
finalized, err := fp.consumerCon.QueryIsBlockFinalized(targetHeight)
if err != nil {
return nil, fmt.Errorf("failed to query block finalization at height %v: %w", targetHeight, err)
}
if finalized {
fp.logger.Debug(
"the block is already finalized, skip submission",
zap.String("pk", fp.GetBtcPkHex()),
zap.Uint64("target_height", targetHeight),
)
// TODO: returning nil here is to safely break the loop
// the error still exists
return nil, nil
}

case <-fp.quit:
fp.logger.Debug("the finality-provider instance is closing", zap.String("pk", fp.GetBtcPkHex()))
return nil, ErrFinalityProviderShutDown
}
}
}
Expand Down

0 comments on commit 2a21b69

Please sign in to comment.