-
Notifications
You must be signed in to change notification settings - Fork 966
Figure out how to get rid of Witness::from_parts__unstable #4062
Copy link
Copy link
Closed
Labels
1.0Issues and PRs required or helping to stabilize the APIIssues and PRs required or helping to stabilize the API
Description
Keeping this function in 1.0 and releasing bitcoin with primitives = "1.0" would mean we will never be able to change the representation of Witness. This is unacceptable and we need to solve it somehow.
Some ideas:
- Have
WitnessBuilderoptimized for creating witnesses, it could be even a public API, however it could require the decoders to allocate scratch space to temporarily store elements (still fewer allocations than each element allocated separately) - Have a simple push-based decoder behind hidden API - no trait, just a struct that can receive bytes and spits out
Witness - Decide to require
primitives < 1.1inbitcoinand then once we release1.2we will also backport a fix to allow higher versions to all releasedbitcoinversions using that condition. We won't change layout unless other features are in. Once decoding is properly implemented byprimitiveswe backport the last fix using it and removing the limit - Make decoding slow in the meantime by naively using the public API
The last two have the advantage that we won't need to keep around old cruft but also have their own short-term downsides. Also God knows what cargo will do about that version thing.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
1.0Issues and PRs required or helping to stabilize the APIIssues and PRs required or helping to stabilize the API