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.
Summary
sp1_primitives::Elfdoes not implementserde::Serialize/serde::Deserialize, while some related types (for exampleSP1VerifyingKey) already support serde.Why this is useful
In my project, I need to persist an
Elfobject in a database.Without serde support, I have to introduce a custom trait / custom serialization layer just for storing and loading this type.
If
ElfimplementedSerializeandDeserialize, it would be much easier to: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
sp1/crates/primitives/src/types.rs
Line 76 in 786ed99
Request
Would you be open to adding
serde::{Serialize, Deserialize}forsp1_primitives::Elf?If this change is welcome, I would be happy to work on a PR.