Skip to content

sp1_primitives: No serde implementation for serde type. #2689

@ecol-master

Description

@ecol-master

Summary

sp1_primitives::Elf does not implement serde::Serialize / serde::Deserialize, while some related types (for example SP1VerifyingKey) already support serde.

Why this is useful

In my project, I need to persist an Elf object in a database.
Without serde support, I have to introduce a custom trait / custom serialization layer just for storing and loading this type.

If Elf implemented Serialize and Deserialize, it would be much easier to:

  • store it in a database,
  • cache it,
  • pass it through application boundaries,
  • reuse existing serde-compatible tooling.

My main use case is storing compiled ELF artifacts in a database and loading them back later without having to maintain a custom wrapper type.

Reference

// todo!(n): implement serde for the ELF type.

Request

Would you be open to adding serde::{Serialize, Deserialize} for sp1_primitives::Elf?

If this change is welcome, I would be happy to work on a PR.

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