chore: bump pallas to v1#100
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughUpgrade Pallas crates to 1.0.0 across workspace and examples, migrate transaction output variants, parameterize transaction-related types with 'static lifetimes, refactor multi-asset math to use standard map types, adjust tx builder encoding to KeepRaw, and update RNG usage for ed25519 key generation. ChangesPallas 1.0.0 Upgrade and Type System Refactoring
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 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.
Actionable comments posted: 1
🧹 Nitpick comments (1)
balius-sdk/src/txbuilder/dsl.rs (1)
569-580: 💤 Low valueConsider returning
Nonewhen mint is empty.
MintBuilder::evalnow always returnsOk(Some(mint))even when the resulting mint map is empty (all policies filtered out). While downstream code handles this viamint.is_empty()checks, returningNonefor an empty mint would be semantically cleaner and consistent withaggregate_assetsbehavior.Suggested improvement
let mint = out .into_iter() .filter_map(|(policy, assets)| { if assets.is_empty() { None } else { Some((policy, assets.into_iter().collect())) } }) .collect(); - Ok(Some(mint)) + if mint.is_empty() { + Ok(None) + } else { + Ok(Some(mint)) + }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@balius-sdk/src/txbuilder/dsl.rs` around lines 569 - 580, MintBuilder::eval currently always returns Ok(Some(mint)) even when the collected mint map is empty; change it to mirror aggregate_assets behavior by checking the collected value (the local variable mint produced from out.into_iter().filter_map(...).collect()) and return Ok(None) when mint.is_empty(), otherwise return Ok(Some(mint)); this keeps the semantic meaning consistent and avoids downstream checks.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@balius-runtime/src/sign/in_memory.rs`:
- Around line 33-36: Replace the non-CSPRNG usage of rand::rng() when creating
an Ed25519 secret key: in the keys.entry(key_name).or_insert_with closure that
calls ed25519::SecretKey::new(&mut rng).into(), instantiate a cryptographically
secure OsRng (rand::rngs::OsRng) and pass it to SecretKey::new instead of
ThreadRng/rand::rng(); ensure you import OsRng and adjust the closure to create
the key via OsRng so the generated key uses a CSPRNG.
---
Nitpick comments:
In `@balius-sdk/src/txbuilder/dsl.rs`:
- Around line 569-580: MintBuilder::eval currently always returns Ok(Some(mint))
even when the collected mint map is empty; change it to mirror aggregate_assets
behavior by checking the collected value (the local variable mint produced from
out.into_iter().filter_map(...).collect()) and return Ok(None) when
mint.is_empty(), otherwise return Ok(Some(mint)); this keeps the semantic
meaning consistent and avoids downstream checks.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 5669d515-d43e-47aa-9eda-3df21ff6b8a1
⛔ Files ignored due to path filters (1)
Cargo.lockis excluded by!**/*.lock
📒 Files selected for processing (17)
balius-runtime/Cargo.tomlbalius-runtime/src/ledgers/mock.rsbalius-runtime/src/sign/in_memory.rsbalius-sdk/Cargo.tomlbalius-sdk/src/txbuilder/asset_math.rsbalius-sdk/src/txbuilder/build.rsbalius-sdk/src/txbuilder/dsl.rsbalius-sdk/src/txbuilder/mod.rsbaliusd/Cargo.tomlexamples/asteria-admin/Cargo.tomlexamples/basic/Cargo.tomlexamples/minter/offchain/Cargo.tomlexamples/minter/offchain/src/lib.rsexamples/sundae-stop-loss-strategy/Cargo.tomlexamples/telchar/Cargo.tomlexamples/ticket-vending-machine/Cargo.tomlexamples/wallet/offchain/Cargo.toml
Summary
Verification
Note: cargo test --workspace compiles, but the existing balius-runtime u5c-chainsync integration test fails with a WIT component import mismatch unrelated to the Pallas v1 changes.
Summary by CodeRabbit
Chores
Refactor