Skip to content

fix: set blockfetch recv queue size to under the limit#547

Merged
agaffney merged 1 commit intomainfrom
fix/blockfetch-recv-queue-size
Nov 25, 2025
Merged

fix: set blockfetch recv queue size to under the limit#547
agaffney merged 1 commit intomainfrom
fix/blockfetch-recv-queue-size

Conversation

@agaffney
Copy link
Copy Markdown
Contributor

@agaffney agaffney commented Nov 24, 2025

Summary by cubic

Set the blockfetch receive queue size to 512 to stay under the limit. It’s still larger than our batch size to keep throughput steady.

Written for commit 02abf0c. Summary will update automatically on new commits.

Summary by CodeRabbit

  • Chores
    • Adjusted block synchronization queue buffer size to reduce memory overhead during data processing operations.

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

Signed-off-by: Aurora Gaffney <aurora@blinklabs.io>
@agaffney agaffney requested a review from a team as a code owner November 24, 2025 23:20
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Nov 24, 2025

📝 Walkthrough

Walkthrough

A configuration parameter in the BlockFetch setup was adjusted, reducing the receive queue size from 1000 to 512 blocks. The accompanying comment was updated to clarify the relationship between the queue size and batch size. No functional logic or control flow modifications were made.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

  • Consider verifying that the reduced queue size (512 vs. 1000) does not negatively impact block synchronization performance or introduce buffering bottlenecks
  • Confirm the updated comment accurately reflects the intended queue sizing strategy relative to the batch size parameter
  • Check if this change aligns with any performance tuning or optimization work across the codebase

Pre-merge checks and finishing touches

✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: adjusting the blockfetch receive queue size to be under a limit, which aligns with the summary's reduction from 1000 to 512.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/blockfetch-recv-queue-size

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
Copy Markdown

@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)
input/chainsync/chainsync.go (1)

243-249: Recv queue size change looks correct; consider clarifying the external limit in the comment

Setting WithRecvQueueSize(512) keeps the queue comfortably above blockBatchSize (500) while addressing the need to stay under the BlockFetch limit, so the behavior here looks good. To help future changes, consider updating the comment to also mention that this value must not exceed the BlockFetch recv-queue limit (and ideally point to where that limit is defined), so someone doesn’t “helpfully” bump it above the allowed maximum later.

For example:

-               // Set the recv queue size to larger than our block batch size
-               blockfetch.WithRecvQueueSize(512),
+               // Set recv queue size > blockBatchSize but <= BlockFetch's max allowed size
+               blockfetch.WithRecvQueueSize(512),

Please double-check that 512 is indeed at or below the current maximum recv queue size supported by blockfetch.WithRecvQueueSize in the version of gouroboros used by this project.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2d0e69a and 02abf0c.

📒 Files selected for processing (1)
  • input/chainsync/chainsync.go (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: cubic · AI code reviewer
  • GitHub Check: Analyze (go)

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 1 file

@agaffney agaffney merged commit 88845a1 into main Nov 25, 2025
11 checks passed
@agaffney agaffney deleted the fix/blockfetch-recv-queue-size branch November 25, 2025 01:51
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.

2 participants