Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,14 @@ on:
- "release/**"

env:
GO_VERSION: 1.25
GO_VERSION: 1.25

jobs:
test:
name: "Test"
runs-on: ubuntu-latest
env:
GRPC_GO_RETRY: "on"
steps:
- uses: actions/checkout@v5
with:
Expand Down
2 changes: 1 addition & 1 deletion server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ func DetectRemoteChainID(url string) (flowgo.ChainID, error) {
grpc.WithDefaultServiceConfig(utils.DefaultGRPCServiceConfig),
)
if err != nil {
return "", err
return "",fmt.Errorf("could not connect to remote access node: %w", err)
}
defer func() { _ = conn.Close() }()
client := flowaccess.NewAccessAPIClient(conn)
Expand Down
21 changes: 6 additions & 15 deletions utils/grpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,27 +18,18 @@

package utils

// DefaultGRPCServiceConfig provides automatic retry configuration for transient gRPC errors.
// This config is applied to all remote gRPC connections to handle network flakiness in CI
// and other environments.
//
// Retries on:
// - UNAVAILABLE: Service temporarily unavailable (e.g., node restarting)
// - RESOURCE_EXHAUSTED: Rate limiting from remote node
// - UNKNOWN: Connection failures, DNS issues, and other network errors
//
// Note: We only retry on clearly transient network/availability errors.
// We do NOT retry on INTERNAL (programming errors), ABORTED (conflicts),
// or DEADLINE_EXCEEDED (to avoid cascading failures on slow services).
// DefaultGRPCServiceConfig configures native gRPC retries for transient failures.
// The empty object wildcard [{}] matches all services and methods.
const DefaultGRPCServiceConfig = `{
"methodConfig": [{
"name": [{"service": ""}],
"name": [{}],
"retryPolicy": {
"maxAttempts": 5,
"initialBackoff": "0.1s",
"maxAttempts": 8,
"initialBackoff": "1s",
"maxBackoff": "30s",
"backoffMultiplier": 2,
"retryableStatusCodes": ["UNAVAILABLE", "RESOURCE_EXHAUSTED", "UNKNOWN"]
}
}]
}`

Loading