Skip to content

Zero-copy XDR view types #5926

@tamirms

Description

@tamirms

Goal

Generate zero-copy "view" types for all XDR types that read fields directly from raw wire bytes lazily — no allocation, no copying, just pointer arithmetic over the wire format. Instead of fully decoding XDR into Go structs, view types only decode the fields you actually access, resulting in significant speedups for selective access patterns.

Background

Inspired by FlatBuffers, Cap'n Proto, and @dmkozh's C++ visitor pattern proof of concept, the approach generates view types alongside the existing Go types.

Tasks

  • XDR parser + code generator toolchain for view types
  • Design view type system (type representations, API surface)
  • Validation support for untrusted data (reject invalid payloads, configurable recursion depth limits)
  • Benchmarks on real ledger data
  • Convenience methods for common access patterns

Metadata

Metadata

Assignees

Projects

Status

In Progress

Relationships

None yet

Development

No branches or pull requests

Issue actions