Skip to content

Commit a38c6fe

Browse files
committed
check sync status in rpc liveness test
1 parent efa4a0b commit a38c6fe

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ All notable changes will be documented here.
66

77
- fix offchain proto warning
88
- remove websocket connection with rpc servers
9+
- check sync status in rpc provider liveness test
910

1011
## [v1.9.0] - 2024-08-20
1112

core/api/grpc.go

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,16 @@ func CheckGRPCHostLiveness(host string) bool {
1818
defer conn.Close()
1919

2020
client := tmservice.NewServiceClient(conn)
21-
_, err = client.GetNodeInfo(context.Background(), &tmservice.GetNodeInfoRequest{})
22-
return err == nil
21+
res, err := client.GetSyncing(context.Background(), &tmservice.GetSyncingRequest{})
22+
if err != nil {
23+
return false
24+
}
25+
26+
if res.Syncing {
27+
return false
28+
}
29+
30+
return true
2331
}
2432

2533
func checkGRPCHostLatency(host string) time.Duration {

0 commit comments

Comments
 (0)