-
Notifications
You must be signed in to change notification settings - Fork 63
docs(changeset): Add section on version compatibility #391
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ValuedMammal
wants to merge
2
commits into
bitcoindevkit:master
Choose a base branch
from
ValuedMammal:doc/changeset
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+36
−5
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -76,12 +76,42 @@ type IndexedTxGraphChangeSet = | |
| /// | ||
| /// Existing fields may be extended in the future with additional sub-fields. New top-level fields | ||
| /// are likely to be added as new features and core components are implemented. Existing fields may | ||
| /// be removed in future versions of the library. | ||
| /// be removed in future versions of the library following the deprecation policy below. | ||
| /// | ||
| /// The authors reserve the right to make breaking changes to the [`ChangeSet`] structure in | ||
| /// a major version release. API changes affecting the types of data persisted will display | ||
| /// prominently in the release notes. Users are advised to look for such changes and update their | ||
| /// application accordingly. | ||
| /// ## 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 | ||
| /// deserialize [`ChangeSet`] data written by version N-1 (one major version back), but this | ||
| /// guarantee does NOT extend to version N-2 or earlier. New fields added in version N must | ||
| /// implement [`Default`] so that when reading N-1 data, absent fields are populated with default | ||
| /// values. | ||
| /// | ||
| /// Limited forward compatibility is provided for downgrades: version N-1 will successfully | ||
| /// deserialize version N data without errors by ignoring unknown fields. Users should be aware that | ||
| /// features introduced in version N will not be available when downgrading to N-1, and that | ||
| /// downgrading can result in loss of data if not backed up. For this reason we recommend carefully | ||
| /// planning major upgrades and backing up necessary data to avoid compatibility issues. | ||
| /// | ||
| /// Fields can be removed using a 3-version deprecation cycle: fields are marked deprecated in | ||
| /// version N with a reason and instructions for migrating, the field is retained in version N+1 | ||
| /// for compatibility where it deserializes but may not be used, and finally removed in version | ||
| /// N+2. This ensures the standard backwards compatibility guarantees while allowing the removal of | ||
| /// deprecated fields. | ||
| /// | ||
| /// ### Responsibilities | ||
| /// | ||
| /// Library authors SHOULD test all upgrade paths using the persistence test suite and in CI. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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? |
||
| /// Library authors MUST document API changes prominently in the release notes and CHANGELOG, | ||
| /// clearly mark deprecated fields including migration instructions, and follow the 3-version | ||
| /// deprecation cycle before removing fields. | ||
| /// | ||
| /// Users SHOULD back up wallet data before major version upgrades, test upgrades in non-production | ||
| /// environments first, and monitor the release notes for warnings and updates. Users MUST complete | ||
| /// migrations within the compatibility window, and not skip major versions (i.e. upgrade major | ||
| /// versions sequentially). | ||
| /// | ||
| /// ### Custom Persistence Implementations | ||
| /// | ||
| /// The resulting interface is designed to give the user more control of what to persist and when | ||
| /// to persist it. Custom implementations should consider and account for the possibility of | ||
|
|
@@ -117,6 +147,7 @@ pub struct ChangeSet { | |
| /// Changes to [`KeychainTxOutIndex`](keychain_txout::KeychainTxOutIndex). | ||
| pub indexer: keychain_txout::ChangeSet, | ||
| /// Changes to locked outpoints. | ||
| #[serde(default)] | ||
| pub locked_outpoints: locked_outpoints::ChangeSet, | ||
| } | ||
|
|
||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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).