Skip to content

Figure out how to get rid of Witness::from_parts__unstable #4062

@Kixunil

Description

@Kixunil

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 WitnessBuilder optimized 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.1 in bitcoin and then once we release 1.2 we will also backport a fix to allow higher versions to all released bitcoin versions using that condition. We won't change layout unless other features are in. Once decoding is properly implemented by primitives we 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    1.0Issues and PRs required or helping to stabilize the API

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions