Skip to content

fix(minibf): bound UTxO block lookups - #1204

Open
Liona-orph wants to merge 1 commit into
txpipe:mainfrom
Liona-orph:fix/874-bounded-utxo-block-lookups
Open

fix(minibf): bound UTxO block lookups#1204
Liona-orph wants to merge 1 commit into
txpipe:mainfrom
Liona-orph:fix/874-bounded-utxo-block-lookups

Conversation

@Liona-orph

@Liona-orph Liona-orph commented Aug 13, 2026

Copy link
Copy Markdown

Closes #874.

What changed

  • replace the unbounded join_all fan-out in the UTxO model loader with a futures stream
  • cap concurrent block_meta_by_tx_hash calls at 64 with buffer_unordered
  • preserve missing-block and error handling and the existing result collection

Validation

  • cargo test -p dolos-minibf --lib (277 passed, 1 ignored)
  • cargo fmt --all -- --check
  • git diff --check

cargo clippy -p dolos-minibf --lib -- -D warnings is currently blocked by two pre-existing for_kv_map warnings in crates/cardano/src/utxoset.rs and crates/cardano/src/roll/dreps.rs; this PR does not touch those files.

Summary by CodeRabbit

  • Performance Improvements
    • Improved the efficiency of block metadata lookups by processing requests asynchronously with controlled concurrency.
    • Preserved existing handling for missing metadata and lookup errors.

@Liona-orph
Liona-orph requested review from a team and scarmuega as code owners August 13, 2026 09:35
@coderabbitai

coderabbitai Bot commented Aug 13, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 2fb053ae-3cb9-489f-884d-85a5f86d3d43

📥 Commits

Reviewing files that changed from the base of the PR and between 957cb38 and 7382206.

📒 Files selected for processing (1)
  • crates/minibf/src/routes/utxos.rs

📝 Walkthrough

Walkthrough

The UTxO route now performs block metadata lookups through an unordered stream with a maximum concurrency of 64. Missing metadata remains omitted, and lookup errors remain converted to INTERNAL_SERVER_ERROR.

Changes

UTxO block lookup concurrency

Layer / File(s) Summary
Bounded metadata lookup stream
crates/minibf/src/routes/utxos.rs
The route replaces join_all with buffer_unordered(BLOCK_LOOKUP_CONCURRENCY). The concurrency limit is 64. Existing handling for missing metadata and lookup errors remains unchanged.

Estimated code review effort: 2 (Simple) | ~10 minutes

Mergeability Score: ⚪ Minimal · up to 73822

This localized change bounds concurrent UTxO block lookups while preserving existing error and result handling, with relevant tests and formatting checks passing; no actionable merge-blocking risk remains.

Possibly related PRs

  • txpipe/dolos#869: Refines the same block metadata lookup logic by replacing join_all with bounded unordered concurrency.

Suggested reviewers: scarmuega, gonzalezzfelipe

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 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 primary change: bounding minibf UTxO block lookups.
Linked Issues check ✅ Passed The PR replaces unbounded join_all with buffer_unordered(64) and preserves lookup handling required by issue #874.
Out of Scope Changes check ✅ Passed The changes are limited to bounded block metadata lookups and preserve existing behavior, with no unrelated modifications.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

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.

Use bounded concurrency for block lookups to prevent resource spikes on large UTxO sets.

1 participant