Skip to content

bumped mostro-core version #517

Merged
grunch merged 2 commits intomainfrom
bump-core
Sep 7, 2025
Merged

bumped mostro-core version #517
grunch merged 2 commits intomainfrom
bump-core

Conversation

@arkanoider
Copy link
Copy Markdown
Collaborator

@arkanoider arkanoider commented Sep 7, 2025

Hi @grunch ,

just bumped mostro-core to 6.50 and changed some errors to warn in app.rs

Summary by CodeRabbit

  • Refactor

    • Lowered log severity for several non-critical parsing/validation paths to reduce noise while preserving processing flow.
  • Chores

    • Upgraded a core dependency to the latest patch release, retaining existing features.
  • Tests

    • Updated test fixtures and sample payloads (invoice format and message field) to reflect revised test data while keeping validation expectations.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Sep 7, 2025

Walkthrough

Bump mostro-core dependency version and adjust three error logs to warnings in the main loop; update two test vectors (Bolt11 invoice prefix and a JSON field name). No public APIs or control flow changes.

Changes

Cohort / File(s) Summary
Dependencies
Cargo.toml
Bump mostro-core from 0.6.490.6.50; preserve features ["sqlx"].
Logging adjustments
src/app.rs
Downgrade three error logs to warnings: rumor content parse failures (message/inner/signature), JSON serialization failure, and trade index check failure; control flow unchanged.
Tests / Invoice
src/lightning/invoice.rs
Replace test zero-amount invoice payment_request constant from a testnet (lnbcrt...) to a mainnet-style (lnbc...) Bolt11 string; test logic unchanged.
Tests / Message JSON
src/main.rs
Update test payload field from "payment_request": null to "buyer_invoice": null in test_wrong_message_should_fail; assertion of verification failure unchanged.

Sequence Diagram(s)

(Skipped — changes are logging and test data updates; no new control flow to illustrate.)

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • Catrya
  • grunch

Poem

I nibble code beneath the moon,
A hop in version, soft and soon.
Errors hush to gentle chime,
Tests adjusted, snug in time.
A rabbit cheers the tiny tune — 🐇✨

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch bump-core

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.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

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 (3)
src/app.rs (3)

325-327: Clarify message and add structured context to the warn.

Current text mentions “inner message” though we parse (Message, Option). Prefer precise wording and fields for triage.

Apply:

-                            tracing::warn!("Failed to parse message, inner message, and signature from rumor content: {}", e);
+                            tracing::warn!(
+                                error = %e,
+                                sender = %event.sender,
+                                rumor_pubkey = %event.rumor.pubkey,
+                                "Failed to parse (Message, Option<Signature>) from rumor content"
+                            );

334-336: Include identifiers in serialization warning for better observability.

Add sender/rumor pubkey to speed up correlation.

Apply:

-                            tracing::warn!("Failed to serialize message: {}", e);
+                            tracing::warn!(
+                                error = %e,
+                                sender = %event.sender,
+                                rumor_pubkey = %event.rumor.pubkey,
+                                "Failed to serialize message to JSON"
+                            );

361-362: Differentiate warn vs error by error kind when checking trade index.

CantDo should be warn; internal faults should stay error. Keeps signal in dashboards after the downgrade.

Apply:

-                        tracing::warn!("Error checking trade index: {}", e);
-                        continue;
+                        match &e {
+                            MostroError::MostroCantDo(_) => {
+                                tracing::warn!(
+                                    error = %e,
+                                    action = ?message.get_inner_message_kind().action,
+                                    trade_index = ?message.get_inner_message_kind().trade_index(),
+                                    sender = %event.sender,
+                                    "CantDo while checking trade index"
+                                );
+                            }
+                            MostroError::MostroInternalErr(_) => {
+                                tracing::error!(
+                                    error = %e,
+                                    action = ?message.get_inner_message_kind().action,
+                                    trade_index = ?message.get_inner_message_kind().trade_index(),
+                                    sender = %event.sender,
+                                    "Internal error while checking trade index"
+                                );
+                            }
+                        }
+                        continue;
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between bfe08f5 and 76fb6fa.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (2)
  • Cargo.toml (2 hunks)
  • src/app.rs (3 hunks)
⏰ 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). (1)
  • GitHub Check: tests
🔇 Additional comments (2)
Cargo.toml (2)

91-91: Build dep pin aligns with runtime versions. LGTM.
Matches tonic/prost 0.14.x; no action needed.


67-67: Install C compiler, verify build with mostro-core 0.6.50 and update Cargo.lock
Build failed due to missing linker (cc). Install a system C compiler, rerun

cargo update -p mostro-core  
cargo check --all-features  

confirm no API or feature changes, and commit the refreshed Cargo.lock.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

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 (1)
src/lightning/invoice.rs (1)

288-291: Zero-amount test now uses a mainnet (lnbc) invoice — fine; consider clarifying intent.

Mixing lnbc/lnbcrt across tests is harmless here since validation is format/expiry based, not network-bound. Adding a short comment avoids future confusion.

-        let payment_request = "lnbc1p5tmmdspp5k37c7l45d97axrq0zrazzrhhyfd5mp338urg08txfp03vjx8evpqdq5g9kxy7fqd9h8vmmfvdjscqzzsxqyz5vqsp5tejy26f4wr7d0gcmrc3ndyzg0md6m7kxj3xrnl7rc4e96hhq7nqq9qxpqysgq48ww59a8w5kszspu9jpuv66smgkwjxedj69c6nrry0zwzn46d38x5g022lr95d4np39cfh6pne59vcrpymxwyrnl379cyymer907etqp2497a8".to_string();
+        // Zero-amount Bolt11; network prefix (lnbc) is irrelevant to the validation under test.
+        let payment_request = "lnbc1p5tmmdspp5k37c7l45d97axrq0zrazzrhhyfd5mp338urg08txfp03vjx8evpqdq5g9kxy7fqd9h8vmmfvdjscqzzsxqyz5vqsp5tejy26f4wr7d0gcmrc3ndyzg0md6m7kxj3xrnl7rc4e96hhq7nqq9qxpqysgq48ww59a8w5kszspu9jpuv66smgkwjxedj69c6nrry0zwzn46d38x5g022lr95d4np39cfh6pne59vcrpymxwyrnl379cyymer907etqp2497a8".to_string();
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 76fb6fa and d556cc0.

📒 Files selected for processing (2)
  • src/lightning/invoice.rs (1 hunks)
  • src/main.rs (1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: Catrya
PR: MostroP2P/mostro#502
File: src/app/release.rs:52-55
Timestamp: 2025-06-25T22:48:44.741Z
Learning: Cross-repository dependencies in Mostro project: when PRs introduce new types like PaymentFailedInfo from mostro-core, compilation errors are expected until the dependency PR is merged and the version is updated in the consuming repository.
📚 Learning: 2025-07-17T13:51:17.338Z
Learnt from: arkanoider
PR: MostroP2P/mostro#499
File: src/lightning/invoice.rs:108-114
Timestamp: 2025-07-17T13:51:17.338Z
Learning: In Lightning invoice validation for Mostro buy orders (src/lightning/invoice.rs), zero-amount invoices (amount_sat == 0) should always pass validation even when an expected amount is provided. This is because users can submit invoices at order creation time before knowing the exact satoshi amount they'll receive. The condition `if amount_sat != res && amount_sat != 0` correctly implements this by allowing zero-amount invoices to pass while enforcing exact amount matching for non-zero invoices.

Applied to files:

  • src/lightning/invoice.rs
⏰ 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). (1)
  • GitHub Check: tests
🔇 Additional comments (1)
src/main.rs (1)

141-144: Confirm buyer_invoice rename and absence of payment_request in tests/fixtures.
Verified no remaining “payment_request” references in any tests or fixtures.

@arkanoider arkanoider requested a review from grunch September 7, 2025 21:32
@grunch grunch merged commit 5523766 into main Sep 7, 2025
2 checks passed
@grunch grunch deleted the bump-core branch March 18, 2026 18:04
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.

2 participants