Conversation
mostro-core 0.10 reshapes wrap_message / unwrap_message to match the Mostro key-management spec: the long-lived identity key signs the seal (kind 13) while the per-trade key authors the rumor (kind 1) and produces the inner tuple signature. Thread both keys through the CLI's send_dm / send_plain_text_dm / publish_gift_wrap pipeline and update every call site: - User order flows (new_order, take_order, add_invoice, orders_info, rate_user, send_msg, send_dm) pass ctx.identity_keys + the per-order trade keys. - Account-scoped requests (restore, last_trade_index) and admin flows (take_dispute, admin_send_dm, adm_send_dm) don't rotate trade keys, so they pass the same key for both — the full-privacy-mode wrap documented in the mostro-core NIP-59 transport spec. - Kind-14 NIP-17 direct messages (to_user = true) are signed with trade_keys directly; identity doesn't apply because there's no seal. Also refreshes the local wrap/unwrap unit tests to cover the identity/trade split and adds a full-privacy-mode assertion. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 10 minutes and 40 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
WalkthroughUpgrades the Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related issues
Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/cli/orders_info.rs (1)
30-53:⚠️ Potential issue | 🟡 MinorUse identity keys for both seal and rumor to match other account-scoped endpoints.
The
orders_infoendpoint queries arbitrary order IDs — a request not bound to a single trade, semantically similar torestoreandlast_trade_index. Both those account-scoped endpoints use(identity_keys, identity_keys)with explicit comments explaining that Mostro indexes users by identity pubkey. For consistency,orders_infoshould do the same: pass&ctx.identity_keysas both the seal signer (3rd argument) and rumor author, and likely settrade_indextoNonein the message.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/cli/orders_info.rs` around lines 30 - 53, The orders_info handler builds a Message with a trade-scoped seal/rumor and uses ctx.trade_index; change Message::new_order to use None for the trade_index (i.e., account-scoped) and pass &ctx.identity_keys for both the seal signer and rumor author when calling send_dm (replace the current &ctx.trade_keys third-arg with &ctx.identity_keys) so it matches restore/last_trade_index behavior and add a short comment that Mostro indexes by identity pubkey.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@src/cli/orders_info.rs`:
- Around line 30-53: The orders_info handler builds a Message with a
trade-scoped seal/rumor and uses ctx.trade_index; change Message::new_order to
use None for the trade_index (i.e., account-scoped) and pass &ctx.identity_keys
for both the seal signer and rumor author when calling send_dm (replace the
current &ctx.trade_keys third-arg with &ctx.identity_keys) so it matches
restore/last_trade_index behavior and add a short comment that Mostro indexes by
identity pubkey.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: df6f44f3-e333-4924-992b-2ba71f7c77a8
⛔ Files ignored due to path filters (1)
Cargo.lockis excluded by!**/*.lock
📒 Files selected for processing (15)
Cargo.tomlsrc/cli/add_invoice.rssrc/cli/adm_send_dm.rssrc/cli/last_trade_index.rssrc/cli/new_order.rssrc/cli/orders_info.rssrc/cli/rate_user.rssrc/cli/restore.rssrc/cli/send_dm.rssrc/cli/send_msg.rssrc/cli/take_dispute.rssrc/cli/take_order.rssrc/util/messaging.rssrc/util/storage.rstests/parser_dms.rs
Orders info is account-scoped — Mostro indexes users by identity pubkey. Drop the trade_index from the message and run the whole exchange (send, wait, decrypt) on identity_keys, matching restore/last_trade_index.
Summary
mostro-core0.9.1 → 0.10.0 to pick up the updated NIP-59 transport that splits signing across a long-lived identity key (seals, kind 13) and a per-trade trade key (rumor, kind 1 + inner tuple signature), as specified in mostro.network/protocol/key_management anddocs/NIP59_TRANSPORT.md.send_dm,send_plain_text_dm, and the internalpublish_gift_wraphelper, then update every CLI call site accordingly:new_order,take_order,add_invoice,orders_info,rate_user,send_msg,send_dm) →ctx.identity_keys+ per-order trade keys.restore,last_trade_index) and admin flows (take_dispute,admin_send_dm,adm_send_dm) → same key for both (full-privacy-mode wrap, per the spec).to_user = true) continue to sign with trade keys directly (no seal involved).identity == senderwhen the sameKeysis passed).Test plan
cargo fmt --allcargo clippy --all-targets --all-features -- -D warningscargo test(all existing suites green)🤖 Generated with Claude Code
Summary by CodeRabbit
Chores
mostro-coredependency to version 0.10.0Refactor