Skip to content

rawElementsInput.annex ought not to be a pointer #311

Description

@apoelstra

In the rawElementsInput struct we have an annex field whose type is const rawElementsBuffer*. But rawElementsBuffer is already a pointer type. Every other instance of rawElementsBuffer is used directly, rather than through a const pointer.

In Elements interpreter.cpp this requires allocating a separate vector simplicityRawAnnex. In Elements we have some assurance that none of the data structures passed to Simplicity will outlive this vector, but it's hard to make this assurance in the general-purpose Rust library. (Our current code has had a TODO for years to support the annex field, which is how we didn't notice this awkwardness.)

I propose replacing the pointer with an inline buffer, as is done for scriptPubKey,the rangeproof and surjection proof, etc.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions