Skip to content

feat: added borsh schema - #506

Open
alejandro-vaz wants to merge 4 commits into
servo:v2from
alejandro-vaz:schema
Open

feat: added borsh schema#506
alejandro-vaz wants to merge 4 commits into
servo:v2from
alejandro-vaz:schema

Conversation

@alejandro-vaz

@alejandro-vaz alejandro-vaz commented Aug 30, 2026

Copy link
Copy Markdown
Collaborator

this PR implements borsh::BorshSchema for SmallVec

the derive and unstable__schema features of borsh had to be enabled

closes #503

schema

SmallVec schema is the same one Vec has

it consists of:

  • an usize for length, that only indicates the amount of items
  • all the elements serialized

this PR changes the serialization in order not to serialize the TaggedLen directly but it's value. this is important because the schema is only correct if the usize represents the amount of elements and not our custom length representation

@alejandro-vaz
alejandro-vaz requested a review from jdm August 30, 2026 16:15
@alejandro-vaz alejandro-vaz self-assigned this Aug 30, 2026
@alejandro-vaz
alejandro-vaz marked this pull request as draft August 30, 2026 19:00
@alejandro-vaz
alejandro-vaz marked this pull request as ready for review August 30, 2026 19:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

add a type implementing BorshSchema of SmallVec

1 participant