Skip to content

chore: deprecate the gift-wrap (protocol v1) transport variant#158

Merged
grunch merged 1 commit into
mainfrom
chore/deprecate-gift-wrap-transport
Jul 3, 2026
Merged

chore: deprecate the gift-wrap (protocol v1) transport variant#158
grunch merged 1 commit into
mainfrom
chore/deprecate-gift-wrap-transport

Conversation

@grunch

@grunch grunch commented Jul 3, 2026

Copy link
Copy Markdown
Member

Summary

Companion to MostroP2P/mostro#786 and MostroP2P/mostro#800: mark Transport::GiftWrap with #[deprecated] so every downstream use of the protocol-v1 transport surfaces a compiler warning during the v1→v2 migration window.

  • #[deprecated] on Transport::GiftWrap with a note pointing to Remove configurable transport and run protocol v2 only in v0.19.0 (revert #785) mostro#786: mostrod v0.19.0 removes its transport setting and runs protocol v2 (nip44) only; the variant will be removed from mostro-core in a following release once the ecosystem completes the migration.
  • The variant stays fully functional. Clients (e.g. mostro-cli's auto-detect fallback) still need it to talk to pre-v2 nodes, so the enum's own impls (event_kind, protocol_version, FromStr, Display, wrap_message_with) and the tests that exercise it carry explicit #[allow(deprecated)] markers — which double as the greppable removal checklist.
  • Default became a manual impl: #[derive(Default)] + #[default] on a deprecated variant trips the deprecation lint at the definition site, and the release hook runs clippy with -D warnings. The default remains GiftWrap for backward compatibility until the v0.19.0 cutover.
  • Module docs updated to flag v1 as deprecated.

No behavior change: wire format, serde representation ("gift-wrap"/"nip44") and all signatures are untouched. Downstream crates that still reference Transport::GiftWrap (mostrod until v0.19.0, mostro-cli) will see a deprecation warning on their next mostro-core bump — that is the point; they silence intentional transitional uses with #[allow(deprecated)], as MostroP2P/mostro#800 already does.

Test plan

  • cargo clippy --all-targets --all-features -- -D warnings — clean (same gate as the release hook)
  • cargo test — 83 unit + 4 doc tests pass
  • cargo fmt
  • Serde/FromStr/Display/default round-trip covered by the existing transport_config_parsing test (unchanged assertions, still passing)

Mark Transport::GiftWrap with #[deprecated]: mostrod v0.19.0 removes
its `transport` setting and runs protocol v2 (nip44) only, and the
variant will be removed from mostro-core in a following release once
the ecosystem completes the v2 migration (MostroP2P/mostro#786).

The variant stays fully functional meanwhile — clients still need it
to talk to pre-v2 nodes — so the enum's own impls and the tests that
exercise it carry explicit #[allow(deprecated)] markers. Default had
to become a manual impl: #[derive(Default)] + #[default] on a
deprecated variant trips the deprecation lint at the definition site
(and the release hook runs clippy with -D warnings). Behavior, wire
format and serde representation are unchanged.
@coderabbitai

coderabbitai Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@grunch, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 42 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: cc9e3c04-27b4-4c3b-96f5-a4dbc5b18d4c

📥 Commits

Reviewing files that changed from the base of the PR and between 482f8a2 and ab71edd.

📒 Files selected for processing (1)
  • src/transport.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/deprecate-gift-wrap-transport

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.

@grunch grunch merged commit e0e4698 into main Jul 3, 2026
11 checks passed
@grunch grunch deleted the chore/deprecate-gift-wrap-transport branch July 3, 2026 17:48
grunch added a commit to MostroP2P/mostro that referenced this pull request Jul 3, 2026
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 added a commit to MostroP2P/mostro that referenced this pull request Jul 3, 2026
…800)

* chore: standardize v0.19.0 deprecation notices for the v1 transport (#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.

* chore: bump mostro-core to 0.14.1 (deprecated gift-wrap variant)

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.
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