Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR switches the Bitcoin app/client wire protocol from postcard/serde serialization to CBOR via minicbor, aiming to make message evolution more forward-compatible through stable numeric indices.
Changes:
- Replaces serde derives with
minicborEncode/Decodederives across common message and error types. - Updates app and client request/response serialization paths from postcard to minicbor.
- Adjusts affected response enum shapes and handler/test pattern matches.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| apps/bitcoin/common/src/message/mod.rs | Defines CBOR encoding for Bitcoin wire protocol message types. |
| apps/bitcoin/common/src/errors.rs | Adds stable CBOR indices for app error variants. |
| apps/bitcoin/common/Cargo.toml | Replaces runtime serde dependency with minicbor. |
| apps/bitcoin/client/src/client.rs | Switches client request serialization and response parsing to minicbor. |
| apps/bitcoin/client/Cargo.toml | Adds minicbor and removes direct postcard dependency. |
| apps/bitcoin/app/src/main.rs | Switches app request parsing and response serialization to minicbor. |
| apps/bitcoin/app/src/handlers/sign_psbt.rs | Updates PSBT signing response construction/tests for new response shape. |
| apps/bitcoin/app/src/handlers/get_master_fingerprint.rs | Updates master fingerprint response construction/tests for new response shape. |
| apps/bitcoin/app/Cargo.toml | Adds minicbor and removes postcard dependency. |
Comments suppressed due to low confidence (1)
apps/bitcoin/common/src/message/mod.rs:104
- This field-bearing enum variant is not marked
#[cbor(map)], so it is encoded positionally instead of with stable field keys. That leavesAccountCoordinates::WalletPolicyoutside the documented forward-compatible encoding scheme and makes adding optional fields to this variant a breaking wire change.
#[n(0)]
WalletPolicy(#[n(0)] WalletPolicyCoordinates),
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This makes it easier to keep the wire protocol forward-compatible.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This makes it easier to keep the wire protocol forward-compatible.