Skip to content

TIP-143: Add serde feature - #9

Open
SoxPopuli wants to merge 1 commit into
mainfrom
csmith/add-serde-feature/vmlltrplxopq
Open

TIP-143: Add serde feature#9
SoxPopuli wants to merge 1 commit into
mainfrom
csmith/add-serde-feature/vmlltrplxopq

Conversation

@SoxPopuli

Copy link
Copy Markdown
Collaborator

Adds serde optional feature for non-rkyv (de)serialization.
Should be rebased after #8 is merged to fix CI

@SoxPopuli
SoxPopuli force-pushed the csmith/add-serde-feature/vmlltrplxopq branch from b4f1bdc to 4a54f7e Compare September 2, 2026 10:53
@SoxPopuli
SoxPopuli marked this pull request as ready for review September 2, 2026 10:54
@SoxPopuli
SoxPopuli force-pushed the csmith/add-serde-feature/vmlltrplxopq branch from 4a54f7e to 78ee590 Compare September 2, 2026 13:44
Comment thread src/map_with_dict.rs
feature = "serde",
serde(bound(
serialize = "K: serde::Serialize, V: serde::Serialize, ST: serde::Serialize",
deserialize = "K: serde::Deserialize<'de>, V: serde::Deserialize<'de>, ST: serde::Deserialize<'de>",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

To protect against maliciously crafted payloads, we'll want to return an error if internal inconsistencies are detected during deserialization.

  • Array sizes for keys and values should be the same, and should match with the maximum possible Mphf output (perhaps a new method on Mphf/RankedBits to calculate the maximum value).
  • Indexes (e.g., in values_index) must be in-bounds for the maximum length.

We'll need similar checks on the preconditions of Mphf and RankedBits.

Alternatively, we could document that the library should only deserialize payloads from trusted sources.

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.

2 participants