Skip to content

refactor(common/class_definition): use bytes::Bytes instead of Vec<u8> for serialized definitions#3357

Open
CHr15F0x wants to merge 2 commits intomainfrom
chris/serialized-defs-use-bytes
Open

refactor(common/class_definition): use bytes::Bytes instead of Vec<u8> for serialized definitions#3357
CHr15F0x wants to merge 2 commits intomainfrom
chris/serialized-defs-use-bytes

Conversation

@CHr15F0x
Copy link
Copy Markdown
Contributor

@CHr15F0x CHr15F0x commented Apr 21, 2026

Fixes: #3351

Because the inner representation is now Bytes it just didn't feel ok to keep the _bytes() suffix in the current methods that use Vec<u8>.

I added into_inner() in the opaque type and From<Bytes> in Sierra and Cairo as a way to allow zero copy reinterpreting when we're sure which kind of definition it is. Maybe it should be Opaque::into_bytes() paired with ::from_bytes() in the two other types 🤷 .

@CHr15F0x CHr15F0x changed the title Chris/serialized defs use bytes refactor(common/class_definition): use bytes::Bytes instead of Vec<u8> for serialized definitions Apr 21, 2026
@CHr15F0x CHr15F0x marked this pull request as ready for review April 21, 2026 17:58
@CHr15F0x CHr15F0x requested a review from a team as a code owner April 21, 2026 17:58
@CHr15F0x CHr15F0x force-pushed the chris/serialized-defs-use-bytes branch from c1bfab1 to 4255aa8 Compare April 22, 2026 08:00
Copy link
Copy Markdown
Contributor

@zvolin zvolin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

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.

refactor(common/class_definition): use bytes::Bytes instead of Vec<u8> for serialized definitions

2 participants