Skip to content

chore(minibf): update blockfrost-openapi to v0.1.83 - #801

Merged
scarmuega merged 1 commit into
mainfrom
chore/bf-api-bump
Nov 27, 2025
Merged

chore(minibf): update blockfrost-openapi to v0.1.83#801
scarmuega merged 1 commit into
mainfrom
chore/bf-api-bump

Conversation

@scarmuega

@scarmuega scarmuega commented Nov 27, 2025

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • New Features

    • Enhanced pool listings with offchain metadata support, enabling retrieval of comprehensive pool information including descriptions, URLs, and ticker details. Metadata is fetched concurrently for improved performance.
  • Chores

    • Updated upstream dependencies to latest versions.
  • Refactor

    • Optimized internal numeric field representations for improved type consistency and efficiency.

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

@coderabbitai

coderabbitai Bot commented Nov 27, 2025

Copy link
Copy Markdown

Walkthrough

Updated blockfrost-openapi dependency from 0.1.75 to 0.1.83. Converted floating-point numeric types to integers in network era construction. Introduced structured offchain pool metadata handling with concurrent fetching capability.

Changes

Cohort / File(s) Summary
Dependency Management
crates/minibf/Cargo.toml
Updated blockfrost-openapi dependency from version 0.1.75 to 0.1.83
Network Data Model Adjustments
crates/minibf/src/routes/network.rs
Replaced floating-point (f64) numeric types with integers for time, slot_length, and related fields in NetworkErasInner object construction; applied consistently across mainnet and preview branches
Pool Metadata Handling
crates/minibf/src/routes/pools.rs
Introduced PoolListExtendedInnerMetadata structured type for metadata composition; added concurrent offchain metadata retrieval via join_all; reworked metadata assembly to combine on-chain and offchain sources with fallback defaults

Sequence Diagram(s)

sequenceDiagram
    participant Caller
    participant PoolService as Pool Service
    participant OnChain as On-Chain Data
    participant Blockfrost as Blockfrost API
    participant MetaBuilder as Metadata Builder

    Caller->>PoolService: Request all_extended pools
    
    par Concurrent Metadata Retrieval
        PoolService->>OnChain: Fetch on-chain pool metadata
        PoolService->>Blockfrost: Fetch offchain metadata for each pool
    and
        OnChain-->>PoolService: On-chain data
        Blockfrost-->>PoolService: Offchain metadata (url, hash, ticker, etc.)
    end

    PoolService->>MetaBuilder: Combine sources
    alt Offchain metadata available
        MetaBuilder->>MetaBuilder: Merge on-chain + offchain fields
    else Offchain metadata missing
        MetaBuilder->>MetaBuilder: Apply defaults
    end

    MetaBuilder-->>PoolService: PoolListExtendedInnerMetadata
    PoolService-->>Caller: Return extended pool list
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~50 minutes

  • crates/minibf/src/routes/pools.rs: Verify concurrent offchain fetching logic, error handling for missing metadata, proper await/join_all usage, and ensure the PoolListExtendedInnerMetadata integration preserves all required fields across the data flow.
  • crates/minibf/src/routes/network.rs: Validate that all float-to-integer conversions preserve intended precision and do not introduce numeric overflow or loss of temporal accuracy across mainnet/preview branches.
  • crates/minibf/Cargo.toml: Confirm blockfrost-openapi 0.1.83 compatibility and any API changes affecting the downstream code.

Possibly related PRs

Poem

🐰 Hops of Joy

Floats to integers we leap with care,
Metadata flowing through the air,
Offchain whispers, concurrent and bright,
Blockfrost's data shines in the night!
Pools grow richer, metadata whole—
What a wonderful patch for the soul! ✨

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Title check ⚠️ Warning The PR title focuses on updating blockfrost-openapi to v0.1.83, but the changeset includes significant logic changes to network.rs and pools.rs beyond the dependency bump. Update the title to reflect all major changes, such as 'chore(minibf): update blockfrost-openapi and refactor network/pool metadata handling' or split into multiple PRs.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (1 passed)
Check name Status Explanation
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
  • Commit unit tests in branch chore/bf-api-bump

Tip

📝 Customizable high-level summaries are now available in beta!

You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.

  • Provide your own instructions using the high_level_summary_instructions setting.
  • Format the summary however you like (bullet lists, tables, multi-section layouts, contributor stats, etc.).
  • Use high_level_summary_in_walkthrough to move the summary from the description to the walkthrough section.

Example instruction:

"Divide the high-level summary into five sections:

  1. 📝 Description — Summarize the main change in 50–60 words, explaining what was done.
  2. 📓 References — List relevant issues, discussions, documentation, or related PRs.
  3. 📦 Dependencies & Requirements — Mention any new/updated dependencies, environment variable changes, or configuration updates.
  4. 📊 Contributor Summary — Include a Markdown table showing contributions:
    | Contributor | Lines Added | Lines Removed | Files Changed |
  5. ✔️ Additional Notes — Add any extra reviewer context.
    Keep each section concise (under 200 words) and use bullet or numbered lists for clarity."

Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later.


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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

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 (2)
crates/minibf/src/routes/pools.rs (1)

148-163: Consider populating the error field when offchain metadata fetch fails.

When fetched_metadata is None but onchain.url exists (lines 159-163), the error field remains None via Default::default(). This makes it impossible for API consumers to distinguish between:

  1. Metadata URL exists but fetch failed/timed out
  2. No metadata URL configured

If this distinction is valuable, consider tracking fetch failures:

-                        None => PoolListExtendedInnerMetadata {
-                            url: Some(onchain.url.clone()),
-                            hash: Some(hex::encode(&*onchain.hash)),
-                            ..Default::default()
-                        },
+                        None => PoolListExtendedInnerMetadata {
+                            url: Some(onchain.url.clone()),
+                            hash: Some(hex::encode(&*onchain.hash)),
+                            error: Some("Failed to fetch offchain metadata".to_string()),
+                            ..Default::default()
+                        },
crates/minibf/src/routes/network.rs (1)

153-174: Verify the u64 to i32 casts won't overflow.

The time delta values (start_delta, end_delta) are u64 but cast to i32 using as i32. This performs a truncating cast that could silently produce incorrect values if the delta exceeds i32::MAX (~68 years).

For Cardano's current age (~8 years), this is safe, but consider using saturating or checked conversion for robustness.

 previous.end = Box::new(NetworkErasInnerEnd {
-    time: start_delta as i32,
+    time: i32::try_from(start_delta).unwrap_or(i32::MAX),
     slot: era.start.slot as i32,
     epoch: era.start.epoch as i32,
 });
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 58cccc2 and 83ee22f.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (3)
  • crates/minibf/Cargo.toml (1 hunks)
  • crates/minibf/src/routes/network.rs (4 hunks)
  • crates/minibf/src/routes/pools.rs (3 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
crates/minibf/src/routes/pools.rs (1)
crates/minibf/src/mapping.rs (1)
  • bech32_pool (104-106)
⏰ 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). (4)
  • GitHub Check: Test (ubuntu-latest)
  • GitHub Check: Test (windows-latest)
  • GitHub Check: Test (macos-14)
  • GitHub Check: Test (macos-13)
🔇 Additional comments (7)
crates/minibf/src/routes/pools.rs (3)

10-10: LGTM on the new import.

The PoolListExtendedInnerMetadata import aligns with the structured metadata handling introduced in this change.


121-138: Good use of concurrent fetching.

The join_all pattern efficiently fetches offchain metadata in parallel. The 5-second timeout per request (line 45) is reasonable.

Consider whether unbounded concurrent requests could cause issues with rate limiting or resource exhaustion when processing many pools. If the pool count is typically bounded by pagination, this should be fine.


175-181: Minor formatting improvements.

The added blank lines improve readability around the stake calculation logic.

crates/minibf/src/routes/network.rs (3)

46-62: LGTM on the integer type conversion for mainnet Byron era.

The hardcoded values for mainnet Byron era (time, slot_length) are now integers, matching the updated blockfrost-openapi API.


70-86: Preprod configuration correctly updated.

The integer conversions mirror the mainnet pattern and values are within safe bounds.


94-134: Preview network configuration looks correct.

The multiple cloned eras for preview (handling skipped eras) and the integer type conversions are appropriate. With end_epoch = 0, the time calculations safely result in 0.

crates/minibf/Cargo.toml (1)

25-25: Dependency update verified and safe to merge.

The blockfrost-openapi version 0.1.83 is legitimate (released 2025-11-25), not yanked, and no security advisories were found. The bump from 0.1.75 aligns with the type changes in network.rs and pools.rs.

@scarmuega
scarmuega merged commit 5ac0844 into main Nov 27, 2025
8 of 12 checks passed
@scarmuega
scarmuega deleted the chore/bf-api-bump branch November 27, 2025 11:46
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.

1 participant