Skip to content

docs(changeset): Add section on version compatibility#391

Open
ValuedMammal wants to merge 2 commits intobitcoindevkit:masterfrom
ValuedMammal:doc/changeset
Open

docs(changeset): Add section on version compatibility#391
ValuedMammal wants to merge 2 commits intobitcoindevkit:masterfrom
ValuedMammal:doc/changeset

Conversation

@ValuedMammal
Copy link
Collaborator

@ValuedMammal ValuedMammal commented Mar 2, 2026

Description

Partially addresses #234 by improving the documentation of ChangeSet by adding a version compatibility policy, clarifying what upgrade/downgrade paths are supported and how breaking changes should be handled. It also adds the #[serde(default)] attribute to locked_outpoints which is a newly added field in 3.0.

In summary the policy says:

  • Changes to the ChangeSet data structure will correspond to a major version bump.
  • Version N can read/deserialize data written by N-1, i.e., one major version back, but this guarantee doesn't extend to version N-2 or earlier.
  • New fields introduced in version N must implement Default so that when deserializing, any missing fields are filled in with the default.
  • Version N-1 can deserialize version N data by ignoring unknown fields, with the caveat that not all features from version N will be available.
  • Outline a 3-version deprecation cycle

Changelog notice

Changed

  • Added #[serde(default)] to ChangeSet::locked_outpoints

Checklists

All Submissions:

This tells serde to use the default value if the field is missing
when deserializing, which is useful when upgrading between
versions.
@ValuedMammal ValuedMammal added this to the Wallet 3.0.0 milestone Mar 2, 2026
@ValuedMammal ValuedMammal self-assigned this Mar 2, 2026
@ValuedMammal ValuedMammal added documentation Improvements or additions to documentation discussion Discussion labels Mar 2, 2026
@codecov
Copy link

codecov bot commented Mar 2, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.17%. Comparing base (c422104) to head (137ba7f).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #391   +/-   ##
=======================================
  Coverage   79.17%   79.17%           
=======================================
  Files          24       24           
  Lines        5311     5311           
  Branches      242      242           
=======================================
  Hits         4205     4205           
  Misses       1029     1029           
  Partials       77       77           
Flag Coverage Δ
rust 79.17% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

@tnull tnull left a comment

Choose a reason for hiding this comment

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

Thank you, I much appreciate this move to clearly define the provided guarantees!

///
/// ### Responsibilities
///
/// Library authors SHOULD test all upgrade paths using the persistence test suite and in CI.
Copy link
Contributor

Choose a reason for hiding this comment

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

Are there any plans to add {backward,forward} compatibility tests in BDK CI to ensure the above described rules are actually enforced at all times?

@notmandatory notmandatory moved this to In Progress in BDK Wallet Mar 3, 2026
@ValuedMammal ValuedMammal moved this from In Progress to Needs Review in BDK Wallet Mar 4, 2026
@ValuedMammal ValuedMammal marked this pull request as ready for review March 4, 2026 04:38
Copy link
Contributor

@oleonardolima oleonardolima left a comment

Choose a reason for hiding this comment

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

ACK 137ba7f

/// ## Version Compatibility
///
/// Any change to the [`ChangeSet`] data structure MUST correlate with a major version bump per
/// [Semantic Versioning](https://semver.org/). We guarantee that version N can read and
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: maybe it's a good idea to also refer to: https://doc.rust-lang.org/cargo/reference/semver.html (not a blocker though).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

discussion Discussion documentation Improvements or additions to documentation

Projects

Status: Needs Review

Development

Successfully merging this pull request may close these issues.

3 participants