Skip to content

chore: standardize v0.19.0 deprecation notices for the v1 transport#800

Merged
grunch merged 2 commits into
mainfrom
chore/deprecation-notices-v019
Jul 3, 2026
Merged

chore: standardize v0.19.0 deprecation notices for the v1 transport#800
grunch merged 2 commits into
mainfrom
chore/deprecation-notices-v019

Conversation

@grunch

@grunch grunch commented Jul 3, 2026

Copy link
Copy Markdown
Member

Summary

Before tagging v0.18.0, mark everything that #786 schedules for removal in v0.19.0 (the transport knob and the version-follows-transport stamping from #785) with a standard, three-layer deprecation notice:

  1. Runtime warning (operator-facing). On startup with transport = "gift-wrap" — the v0.18 default — mostrod now logs a WARN saying protocol v1 is deprecated, v0.19.0 runs protocol v2 only, and linking to Remove configurable transport and run protocol v2 only in v0.19.0 (revert #785) #786. This is the notice that actually reaches node operators during the transition window.

  2. Rust #[deprecated] attribute (compiler-enforced). Applied to the three items that get deleted:

    • MostroSettings::transport (src/config/types.rs)
    • Settings::get_transport() (src/config/settings.rs)
    • stamp_protocol_version() (src/util.rs)

    Every internal use now carries an explicit #[allow(deprecated)], so when preparing v0.19.0 a grep for allow(deprecated) lists every call site to revert.

  3. Greppable comment convention. DEPRECATED(v0.19.0, #786): <what goes away> at each affected site (main.rs subscription, app.rs kind filter, nip33.rs protocol_version tag, settings.tpl.toml). grep -rn "DEPRECATED(v0.19.0" yields the complete removal checklist for that release.

  4. mostro-core 0.14.1 bump. chore: deprecate the gift-wrap (protocol v1) transport variant mostro-core#158 (released as 0.14.1) marks Transport::GiftWrap itself #[deprecated], so the compiler layer also covers direct uses of the v1 variant. The one intentional use it surfaced here — the startup deprecation-warning check in main.rs — carries the same explicit #[allow(deprecated)] marker.

No behavior change beyond the new startup warning: the protocol_version info tag, the subscription kind, and all message stamping are byte-identical.

Related: #786 (lifecycle plan), #785 (transitional mechanism being marked), MostroP2P/mostro-core#158 (core-side deprecation).

Test plan

  • cargo build — clean, no deprecation warnings escape their allow markers (including serde derive on the config struct)
  • cargo clippy --all-targets --all-features -- -D warnings — clean, on mostro-core 0.14.1
  • cargo test — 501 passed, 0 failed
  • cargo fmt
  • Manual: start mostrod with default settings and confirm the gift-wrap deprecation WARN appears once at startup

Summary by CodeRabbit

  • Bug Fixes

    • Added clearer runtime warnings when the soon-to-be-removed transport option is selected, including a deprecation notice and transition to protocol v2-only behavior.
    • Updated protocol version tagging to avoid deprecated access patterns.
  • Documentation

    • Expanded configuration inline comments to clarify the v0.19.0 removal timeline and reference the related issue.
  • Chores

    • Marked the transport-related setting/accessors as deprecated and suppressed resulting deprecation warnings across relevant code paths and tests.
    • Bumped the mostro-core dependency patch version.

…786)

The transport = "gift-wrap" knob and the version-follows-transport
stamping from PR #785 are transitional: v0.19.0 removes them and runs
protocol v2 (nip44) only. Mark every site that goes away with three
layers of notice:

- Runtime: mostrod logs a startup WARN when it runs the deprecated
  gift-wrap (protocol v1) transport, pointing operators to issue #786.
- Compiler: #[deprecated(since = "0.18.0")] on the transport setting
  field, Settings::get_transport() and stamp_protocol_version(), so
  every internal use carries an explicit #[allow(deprecated)] marker.
- Greppable comments: DEPRECATED(v0.19.0, #786) at each site, so
  `grep -rn "DEPRECATED(v0.19.0"` yields the removal checklist when
  preparing that release.

No behavior change beyond the new startup warning.
@coderabbitai

coderabbitai Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

This PR deprecates the transport configuration path and its dependent call sites ahead of v0.19.0 removal, adds a runtime GiftWrap warning, updates related documentation and tests, and bumps mostro-core to 0.14.1.

Changes

Transport deprecation

Layer / File(s) Summary
Transport field and accessor deprecation
src/config/types.rs, src/config/settings.rs, settings.tpl.toml
MostroSettings.transport and Settings::get_transport() are annotated with #[deprecated], default initialization/tests suppress the new warnings, and the settings template comment is expanded with the v0.19.0 removal note.
Call site suppression and warnings
src/app.rs, src/main.rs, src/nip33.rs
Transport branching, startup logging, and protocol-version tag computation add #[allow(deprecated)]; main.rs now logs a warning when transport is GiftWrap.
stamp_protocol_version deprecation
src/util.rs
stamp_protocol_version is deprecated, and send_dm plus its tests suppress the resulting warnings.
Dependency version bump
Cargo.toml
mostro-core is updated from 0.14 to 0.14.1 with sqlx still enabled.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related issues

Possibly related PRs

  • MostroP2P/mostro#776: Touches the same transport-v2 plumbing now being deprecated in settings, app, main, and nip33.
  • MostroP2P/mostro#781: Changes the same startup transport logging flow that now emits the GiftWrap deprecation warning.
  • MostroP2P/mostro#785: Introduced the protocol-version stamping path that util.rs now marks deprecated.

Suggested reviewers: AndreaDiazCorreia

Poem

A rabbit hops through code so old,
and tags of deprecation glow. 🐇
GiftWrap sighs, then steps aside,
while v2 keeps the run alive.
Small warnings hum, the tests still pass—
I nibble logs and hop along fast.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: standardizing v0.19.0 deprecation notices for the v1 transport.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/deprecation-notices-v019

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.

mostro-core 0.14.1 marks Transport::GiftWrap #[deprecated]
(MostroP2P/mostro-core#158), completing the compiler layer of the
v0.19.0 deprecation notices: every downstream use of the protocol-v1
transport now warns. The one intentional use this bump surfaced — the
startup deprecation-warning check itself in main.rs — gets the same
explicit #[allow(deprecated)] marker as the rest of the transitional
call sites.
@grunch

grunch commented Jul 3, 2026

Copy link
Copy Markdown
Member Author

@codex review

@grunch grunch merged commit 7a11ac8 into main Jul 3, 2026
8 checks passed
@grunch grunch deleted the chore/deprecation-notices-v019 branch July 3, 2026 18:03

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bbee975391

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread settings.tpl.toml
Comment on lines 56 to +59
# "gift-wrap" - protocol v1, NIP-59 gift wraps (kind 1059). DEPRECATED,
# will be removed in v0.19.0.
# will be removed in v0.19.0 — mostrod will then run protocol
# v2 only and this setting disappears. See
# https://github.com/MostroP2P/mostro/issues/786

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3 Badge Use the greppable deprecation marker here

This template is listed as part of the v0.19.0 removal checklist, but it is the only touched site that does not include the exact DEPRECATED(v0.19.0, #786) marker. As a result, the documented grep -rn "DEPRECATED(v0.19.0" checklist will miss settings.tpl.toml, making it easy to leave the deprecated transport default advertised when the knob is removed.

Useful? React with 👍 / 👎.

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