Skip to content

C-a · Zero-copy event input — borrow-ify KeriEvent across serder #129

Description

@joeldsouzax

Reshape cesr::keri::KeriEvent and its variant structs (InceptionEvent, RotationEvent, InteractionEvent, DelegatedInceptionEvent, DelegatedRotationEvent) from owned 'static to borrowed <'a> with Cow<'a, [T]> lists, threading the lifetime through serder serialize / builder / deserialize (~18 files).

Why

K1 (#87) keeps the fold's input as today's owned KeriEvent to stay focused on the state-machine logic. This card delivers the zero-copy event input goal: by the time an event reaches validate, the key/digest/signature bytes are borrowed straight out of the source buffer (CESR qb2 / at-rest archive), not copied.

Scope

  • KeriEvent<'a> + variants: primitives already Matter<'a,…>; lists become Cow<'a,[T]>.
  • serder::deserialize_event(raw: &[u8]) -> KeriEvent<'a> borrows from raw.
  • serialize/builder path threaded for lifetimes (may keep constructing 'static via Cow::Owned).
  • K1's validate/apply are already lifetime-generic, so they absorb this with no signature change.

Notes

  • Break called out in CHANGELOG (active-development policy).
  • Zero-copy only materializes for borrow-able formats; qb64/JSON still decode-allocates.

Spawned from #87 (K1) design, 2026-07-05.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions