You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Implement four extractor functions that derive the data shapes RPC v2 needs from an xdr.LedgerCloseMetaView, using zero-copy aliasing into the source LCM. The perf benefits of zero-copy XDR views were validated on rpc-hack, so v2 will adopt them. Most of this code exists on rpc-hack already; the task is largely promoting it from bench-quality into a production package.
What to build
Four extractors over xdr.LedgerCloseMetaView:
events — yields events-index payloads.
tx-hashes — yields the txHash for each transaction in the LCM.
tx-details by hash — given an LCM + target txhash, returns the transaction's envelope / result / meta.
tx-pages — yields transactions in order with cursor support for the paginated getTransactions API.
All outputs zero-copy, aliasing into the source LCM buffer.
The stellar-rpc-side code lives in cmd/stellar-rpc/internal/fullhistory/views/ (or similar).
Determine the SDK vs stellar-rpc split
Part of this task: decide which pieces belong in go-stellar-sdk (alongside the view types) versus stellar-rpc. Rule of thumb — low-level XDR navigation primitives go to the SDK; RPC-specific data shapes (e.g., events.Payload, pagination cursors) stay here.
Source material on rpc-hack
Most of this code exists on rpc-hack already and can be cleaned up rather than written from scratch:
tx-pages — bench_cold_txpage.go / bench_hot_txpage.go for reference; reusability TBD.
Tests + benchmarks
Per-extractor unit tests.
Per-extractor go test -bench benchmarks so perf regressions are catchable.
Differential correctness against the full-decode (UnmarshalBinary → derive) path on a checked-in fixture set covering recent ledgers, protocol-transition ledgers, and known edge cases (empty / sponsorship / large tx / V0/V1/V2 variants).
Follow-up (separate issue): a harness that walks every ledger in history and asserts view-extraction matches full-decode. Not blocking the initial PR.
Acceptance
Four extractors implemented with zero-copy outputs.
SDK vs stellar-rpc split decided.
Tests + benchmarks present for each.
Fixture-set differential tests passing.
Follow-up issue filed for the full-history sweep harness.
TL;DR
Implement four extractor functions that derive the data shapes RPC v2 needs from an
xdr.LedgerCloseMetaView, using zero-copy aliasing into the source LCM. The perf benefits of zero-copy XDR views were validated onrpc-hack, so v2 will adopt them. Most of this code exists onrpc-hackalready; the task is largely promoting it from bench-quality into a production package.What to build
Four extractors over
xdr.LedgerCloseMetaView:txHashfor each transaction in the LCM.getTransactionsAPI.All outputs zero-copy, aliasing into the source LCM buffer.
The stellar-rpc-side code lives in
cmd/stellar-rpc/internal/fullhistory/views/(or similar).Determine the SDK vs stellar-rpc split
Part of this task: decide which pieces belong in
go-stellar-sdk(alongside the view types) versusstellar-rpc. Rule of thumb — low-level XDR navigation primitives go to the SDK; RPC-specific data shapes (e.g.,events.Payload, pagination cursors) stay here.Source material on rpc-hack
Most of this code exists on
rpc-hackalready and can be cleaned up rather than written from scratch:cmd/stellar-rpc/internal/events/ingest_view.go(production-ready; originally in PR events,eventstore: concurrent index; migrate off membitmaps #756, will be scoped out of that PR and land via this task instead).cmd/stellar-rpc/scripts/bench-fullhistory/tx_hash_helpers.go,extract_views.go,bench_cold_txhash.go(bench-quality; needs promotion).bench_cold_txpage.go/bench_hot_txpage.gofor reference; reusability TBD.Tests + benchmarks
go test -benchbenchmarks so perf regressions are catchable.UnmarshalBinary→ derive) path on a checked-in fixture set covering recent ledgers, protocol-transition ledgers, and known edge cases (empty / sponsorship / large tx / V0/V1/V2 variants).Acceptance