Skip to content

Conversation

@Gkirito
Copy link
Contributor

@Gkirito Gkirito commented Dec 18, 2025

Closes: #940

Description

Enhance the gRPC client setup by introducing default call options to improve message size handling. This change ensures better management of message sizes during client-server communication.


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

Summary by CodeRabbit

  • Chores
    • Updated internal service communication configuration to establish consistent maximum message size limits across all connections, enhancing reliability and data transmission consistency.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 18, 2025

Walkthrough

A single file modification in bootstrap/bootstrap.go adds gRPC maximum received message size configuration to past spork host client creation, directly addressing synchronization failures caused by oversized gRPC messages.

Changes

Cohort / File(s) Summary
gRPC Configuration Enhancement
bootstrap/bootstrap.go
Added MaxCallRecvMsgSize gRPC dial option to past spork client setup in setupCrossSporkClient to prevent ResourceExhausted errors when receiving messages larger than the default 4MB limit

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

  • Verify the DefaultMaxMessageSize constant is appropriately defined and large enough to handle expected block event payloads
  • Confirm the gRPC dial option syntax is correctly applied and consistent with the rest of the codebase
  • Check if similar limits should be applied to other gRPC client configurations in the same file or related bootstrap code

Poem

🐰 A message too wide made the sync go crunch,
We bumped the gRPC limit—now sporks have their lunch!
No more ResourceExhausted in the logs so blue,
Just smooth blockchain sailing through and through! ✨

Pre-merge checks and finishing touches

✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately reflects the main change: enhancing gRPC client setup with default call options for message size handling.
Linked Issues check ✅ Passed The PR addresses issue #940 by adding gRPC dial options to set maximum received message size for past spork host clients, directly fixing the ResourceExhausted error.
Out of Scope Changes check ✅ Passed All changes are scoped to the setupCrossSporkClient function and directly address the gRPC message size handling requirement from issue #940.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
bootstrap/bootstrap.go (1)

517-521: Verify retry interceptor consistency across spork clients.

The fix correctly adds MaxCallRecvMsgSize to past spork clients, which will resolve the message size errors. However, the current spork client (lines 496-505) includes both MaxCallRecvMsgSize and a retryInterceptor for handling ResourceExhausted errors, while past spork clients only receive the message size configuration.

Consider adding the retry interceptor to past spork clients as well for consistent error handling behavior.

🔎 Apply this diff to add retry interceptor to past spork clients:
 		grpcClient, err := grpc.NewClient(host,
 			grpc.WithGRPCDialOptions(
 				grpcOpts.WithDefaultCallOptions(grpcOpts.MaxCallRecvMsgSize(DefaultMaxMessageSize)),
+				grpcOpts.WithUnaryInterceptor(retryInterceptor(
+					DefaultResourceExhaustedMaxRetryDelay,
+					DefaultResourceExhaustedRetryDelay,
+				)),
 			),
 		)
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b961d2f and c49bb95.

📒 Files selected for processing (1)
  • bootstrap/bootstrap.go (1 hunks)

Copy link
Collaborator

@m-Peter m-Peter left a comment

Choose a reason for hiding this comment

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

Nice catch 💯

@m-Peter m-Peter merged commit 137c745 into onflow:main Dec 19, 2025
2 checks passed
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.

An error occurred during the synchronization process due to a large gRPC message size

2 participants