-
Notifications
You must be signed in to change notification settings - Fork 6
chore: Update u5c #94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughDependency bump for utxorpc (0.10.0 → 0.12.0), restructured event handling in chainsync driver with explicit None branches, refactored read_params error handling, and updated ChainPoint/BlockRef construction to use slot field instead of index with added height field. Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45–60 minutes
Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
balius-runtime/src/ledgers/u5c.rs (1)
128-147: Critical API structure mismatch: ReadParamsResponse usesvaluesfield, notparams.The review incorrectly approves changes that contradict the actual utxorpc API. According to the official utxorpc documentation,
ReadParamsResponsecontains avaluesfield (typeAnyChainParams), not aparamsfield. The code accessesres.params.ok_or(...)which appears to be incorrect and would fail at runtime against the actual utxorpc 0.12.0 API. The response structure should be:
values: AnyChainParams(envelope containingcardano.PParamsfor Cardano chains)ledger_tip: ChainPoint(chain point metadata)The code needs to access
res.valuesand properly destructure theAnyChainParamsenvelope to reach the Cardano parameters, notres.params.
🧹 Nitpick comments (1)
balius-runtime/src/drivers/chainsync.rs (1)
46-62: TipEvent handling correctly adapted to Option wrapper.The match arms properly handle the new
Option<TipEvent>return type from utxorpc 0.12.0.Potential concern: The
Nonearm logs a warning and continues the loop. If the upstream repeatedly returnsNone, this could result in a busy-loop consuming CPU without making progress. Consider adding a small delay or backoff when receivingNone:None => { tracing::warn!("Received None response from follow_tip, skipping") + tokio::time::sleep(std::time::Duration::from_millis(100)).await; }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
Cargo.lockis excluded by!**/*.lock
📒 Files selected for processing (4)
balius-runtime/Cargo.toml(1 hunks)balius-runtime/src/drivers/chainsync.rs(2 hunks)balius-runtime/src/ledgers/u5c.rs(1 hunks)balius-runtime/src/lib.rs(2 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
balius-runtime/src/drivers/chainsync.rs (1)
balius-runtime/src/lib.rs (2)
slot(157-161)slot(265-269)
⏰ 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: build
- GitHub Check: lint
🔇 Additional comments (3)
balius-runtime/src/lib.rs (2)
157-161: LGTM! Field access updated to match new API.The change from
point.indextopoint.slotaligns with the utxorpc 0.12.0 API whereBlockRefnow usesslotinstead ofindex.
281-289: BlockRef construction correctly updated for utxorpc 0.12.0.The struct now uses
slot(instead ofindex) and includes the newheightfield. Both changes align with the updated dependency API.Note: The repeated
.unwrap()calls onblock.header.as_ref()follow the existing pattern in this file. Consider extracting the header once if this becomes a performance-sensitive path, but it's acceptable for now.balius-runtime/src/drivers/chainsync.rs (1)
100-109: Initial reset validation correctly updated.The check now handles
Some(TipEvent::Reset(...))and correctly usespoint.slotfor logging, consistent with the BlockRef field changes.
| utxorpc = { version = "0.12.0" } | ||
| # utxorpc = { path = "../../../utxorpc/rust-sdk" } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
curl -s https://crates.io/api/v1/crates/utxorpc | jq '.crate | {name, max_version, newest_version, versions: [.versions[0:5] | .[] | {num, created_at}]}'Repository: txpipe/balius
Length of output: 170
🏁 Script executed:
# Also check the crate documentation and recent activity
curl -s https://crates.io/api/v1/crates/utxorpc/0.12.0Repository: txpipe/balius
Length of output: 170
🌐 Web query:
utxorpc 0.12.0 crate crates.io
💡 Result:
I couldn't find a crates.io package named "utxorpc" at version 0.12.0. Related packages I found are "utxorpc-spec" / spec variants (documentation on docs.rs) and a PyPI package "utxorpc-spec" (release history includes 0.12.0). (docs.rs)
Would you like me to search crates.io for similarly named crates or check a specific repository?
Citations:
🌐 Web query:
utxorpc Rust crate crates.io versions
💡 Result:
Here are current Rust crate versions I found for UTxO RPC–related crates:
- utxorpc — 0.11.0. [1]
- utxorpc-spec — 0.17.0. [2]
- pallas-utxorpc — 0.32.1. [3]
Sources: libraries.io/crates pages and docs.rs listings. References:
[1] libraries.io — utxorpc crate.
[2] libraries.io — utxorpc-spec crate.
[3] docs.rs / libs — pallas-utxorpc crate.
utxorpc version 0.12.0 does not exist; use 0.11.0 instead.
The version specified (0.12.0) is not available on crates.io. The latest version of the utxorpc crate is 0.11.0. Update the dependency to avoid build failures.
utxorpc = { version = "0.11.0" }
🤖 Prompt for AI Agents
In balius-runtime/Cargo.toml around lines 26 to 27 the dependency is pinned to
utxorpc = "0.12.0" which does not exist on crates.io; change the dependency to
use the existing latest version utxorpc = "0.11.0" by updating the version
string accordingly so Cargo can resolve the crate and the project will build.
Summary by CodeRabbit
Release Notes
Bug Fixes
Chores
✏️ Tip: You can customize this high-level summary in your review settings.