Skip to content

Conversation

@jribbink
Copy link
Contributor

@jribbink jribbink commented Nov 18, 2025

The previous PR #916 unintentionally committed changes via auto-merge. This PR corrects these.

It was discovered that the built-in GRPC retry mechanism does not always work with Flow public access nodes, as it instructs clients not to retry despite eventually having sufficient resources to reschedule requests. For this reason, I have just switched this to a simple client middleware.


For contributor use:

  • Targeted PR against master branch
  • Linked to GitHub issue with discussion and accepted design OR link to spec that describes this work
  • Code follows the standards mentioned here
  • Updated relevant documentation
  • Re-reviewed Files changed in the GitHub PR explorer
  • Added appropriate labels

@jribbink jribbink force-pushed the jribbink/revert-bad-changes branch 2 times, most recently from 3b18b74 to b92241f Compare November 18, 2025 22:55
@jribbink jribbink changed the title Revert unintentionally committed changes Switch to client-side GRPC retry interceptor Nov 18, 2025
@jribbink jribbink marked this pull request as ready for review November 18, 2025 22:56
@chasefleming chasefleming requested a review from Copilot November 18, 2025 23:00
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR replaces the native gRPC retry mechanism with a custom client-side retry interceptor to address issues where Flow public access nodes instruct clients not to retry despite having resources available. The implementation includes comprehensive logging and error handling improvements.

Key Changes:

  • Implemented custom gRPC retry interceptor with exponential backoff in utils/grpc.go
  • Updated all gRPC client instantiations to use the new retry interceptor
  • Enhanced error handling by changing NewEmulatorServer to return errors instead of nil

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
utils/grpc.go Replaced service config constant with client-side retry interceptor implementation
storage/remote/store.go Updated to use new retry interceptor instead of service config
storage/checkpoint/checkpoint_test.go Changed test logger to Nop logger
server/server_test.go Updated test error handling for new NewEmulatorServer signature
server/server.go Changed NewEmulatorServer to return errors; enhanced logging in DetectRemoteChainID
server/fork_integration_test.go Updated tests for new error handling and added buffer to fork height
cmd/emulator/start/start.go Updated error handling for NewEmulatorServer
.github/workflows/ci.yml Removed GRPC_GO_RETRY environment variable

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

)

const (
defaultMaxAttempts = 10
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should these be configurable for any reason?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It could be fine tuned, but imo this is a good enough general number for now.

@jribbink jribbink force-pushed the jribbink/revert-bad-changes branch from c7e0d81 to c099e94 Compare November 18, 2025 23:11
@jribbink jribbink enabled auto-merge (squash) November 18, 2025 23:21
@jribbink jribbink merged commit 5635be9 into master Nov 18, 2025
3 checks passed
@jribbink jribbink deleted the jribbink/revert-bad-changes branch November 18, 2025 23:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants