fix(chain,core): prevent serde from implicitly leaking std into no_std environments - #2227
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2227 +/- ##
=======================================
Coverage 78.84% 78.84%
=======================================
Files 31 31
Lines 6060 6060
Branches 288 288
=======================================
Hits 4778 4778
Misses 1203 1203
Partials 79 79
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
notmandatory
left a comment
There was a problem hiding this comment.
ACK cc4cef4
Good catch finding that rc isn't needed for bdk_core.
oleonardolima
left a comment
There was a problem hiding this comment.
utACK cc4cef4
I merged the update of rustc, so you'll need to rebase it run with the latest CI.
f70adb5 to
29d1f5b
Compare
b68caf5 to
60c8d21
Compare
|
@EliteCoder18 can you please rebase this one? that should fix the required CI checks. Then it looks like it's ready to merge. Thanks! |
60c8d21 to
373d0c9
Compare
373d0c9 to
0790f04
Compare
|
@notmandatory Rebased onto the latest |
Description
Fix silent
serde/stdleak inbdk_coreandbdk_chainboth crates declared theirserdeoptional dependency withoutdefault features = false, causing serde's std feature to activate unconditionally even in no_std builds.bdk_core: addeddefault-features = false+serde?/stdin std feature.rcthe only two serde-derived types (BlockId,ConfirmationBlockTime) are pure scalars needing neitherserde/rcnorserde/alloc.bdk_chain: addeddefault-features = falseand explicitly enabledallocandrcdirectly on theserde dep+serde?/stdin std. Both are required becausetx_graph::ChangeSetholdsBTreeSet<Arc<Transaction>>andserdegatesArc<T>: Serializebehindall(feature = "rc", any(feature = "std", feature = "alloc")).This fix was identified while working on (bitcoindevkit/bdk_wallet#494).
Notes to the reviewers
The
allocandrcfeatures are placed on the serde dependency directly rather than behind a separate feature flag becausebdk_chainunconditionally requiresallocanyway.Changelog notice
Checklists
All Submissions: