Skip to content

feat(primitives): implement serde for Elf type#2691

Open
gabrielrondon wants to merge 1 commit into
succinctlabs:mainfrom
gabrielrondon:feat/elf-serde
Open

feat(primitives): implement serde for Elf type#2691
gabrielrondon wants to merge 1 commit into
succinctlabs:mainfrom
gabrielrondon:feat/elf-serde

Conversation

@gabrielrondon

Copy link
Copy Markdown

Closes #2689

Summary

Implement Serialize and Deserialize for sp1_primitives::Elf, replacing the // todo!(n) comment.

Both variants serialize as byte slices. Deserialization always produces the Dynamic variant since Static requires a 'static lifetime that cannot be constructed from owned data.

This enables storing compiled ELF artifacts in databases, caching them, and passing them through application boundaries using standard serde-compatible tooling.

Changes

  • Manual Serialize/Deserialize impl for Elf in crates/primitives/src/types.rs
  • Two roundtrip tests (Dynamic and Static variants)
  • No new dependencies (uses existing serde and bincode)

@ecol-master

Copy link
Copy Markdown

Hello, @gabrielrondon , please update your branch to main

@gabrielrondon gabrielrondon force-pushed the feat/elf-serde branch 2 times, most recently from 87ba0ac to 898c516 Compare April 8, 2026 07:19
Implement `Serialize` and `Deserialize` for `sp1_primitives::Elf`,
enabling storage in databases, caching, and passing through application
boundaries without custom wrapper types.

Both variants serialize as byte slices. Deserialization always produces
the `Dynamic` variant since `Static` requires a `'static` lifetime that
cannot be constructed from owned data.

Closes succinctlabs#2689
@gabrielrondon

Copy link
Copy Markdown
Author

Rebased onto main to resolve the conflicts; the branch is now up to date. Thanks for the review, @ecol-master!

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.

sp1_primitives: No serde implementation for serde type.

2 participants