Skip to content

Binary_sv2: Add owned primitive sv2 types #2180

Description

@Shourya742

Based on our findings in #2136, the incremental path forward, without breaking all lower-level dependencies, is to introduce owned SV2 primitives instead of deprecating the Inner representation of SV2 primitives immediately.

Ideally, in the future, we would like to fully deprecate the Inner representation and instead have distinct Owned and Ref types. This would allow users of binary_sv2 to decide how they want to structure and scope their ADTs, very similar to how serde approaches ownership and borrowing.

With the introduction of owned SV2 primitive types, changes will need to be made across parser_sv2 and the subprotocol crates by introducing owned variants of SV2 messages. Alongside this, the into_static method should be updated to return owned message variants instead of owned variants of Inner binary SV2 constructs.

After that, we can begin migrating sv2-apps to this owned-type framework.

Once the migration has successfully propagated up the stack to sv2-apps, we can start removing the Inner types entirely and replace them with concrete Ref types that can be converted into Owned variants when required.

At a high level, this is essentially a transition from a single Inner type abstraction into separate Ref and Owned representations with explicit ownership semantics.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    Todo 📝
    Status
    Todo 📝

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions