Skip to Content
shapekit

Introduction

A test kit for software that reads the Stellar ledger: a corpus of rare but valid XDR shapes, most of them recorded on a real stellar-core, a replay harness that feeds them to an indexer, a conformance runner that feeds them to the JavaScript, Go, Rust, Python, Java, Dart, PHP, .NET and Kotlin Multiplatform SDKs, to soroban-sdk, the Rust contract SDK, and to the stellar xdr commands of stellar-cli, a linter for Go indexer code, and an indexer-hardening guide.

Indexers and SDKs keep breaking on shapes that are valid but rare: signed-payload signers, muxed accounts, deep Soroban authorization trees, trustlines created by the Stellar Asset Contract, maps whose keys collide after conversion. Each team finds the same bugs on its own. shapekit is the shared set of those shapes plus the tools to run them. It is built in response to the SDF RFP "XDR/CAP-Coverage Audit Tool and Indexer-Hardening Guide", and covers protocol 30 (stellar-core 30.0.0, stellar-xdr v30.0).

The dated log of what has landed is STATUS.md. The technical architecture of every part, its interfaces and pins, and how it connects to the Stellar network software are in Technical architecture.

What is in it

PartWhereDocumentation
Corpus: XDR files plus a language-neutral manifest with expected decoded values, generated under both the testnet and mainnet passphrases, checked against stellar-core's --check-lcm goldenscorpus/coverage per CAP, adding a shape
Generator: recipes recorded on a standalone stellar-core on a Docker network with no route off the hostcrates/shapekit-gen, crates/shapekit-core-driveradding a shape
Replay harness, the wallet-backend reference adapter, adapters for stellar-etl and stellar-rpc, and the mapped adapter for PostgreSQL indexerscrates/shapekit-harness, crates/shapekit-mapped, adapters/adapter interface, mapping file, replay server, running it in an indexer's CI
SDK conformance runner and the testees for the Rust, Go, JavaScript, Python, Java, Dart, PHP, .NET and Kotlin Multiplatform SDKs and soroban-sdkcrates/shapekit-conformance, testees/, conformance/testee protocol, running it in an SDK's CI, seeded faults
Fuzzing: stellar-xdr against go-stellar-sdk, a coverage-guided search across the Rust, Go and JavaScript SDKs, and each SDK's own fuzzer checked by the encoding lawscrates/shapekit-fuzz, testees/*/fuzzdifferential fuzzing
Linter for Go indexers built on go-stellar-sdklint/indexerlint
Indexer-hardening guide, written for developers.stellar.org; a draft until a stellar-core or platform engineer has reviewed it (see the guide publication gate)docs/guide/the guide
Findings from running the corpus, each with its severity, affected component and corpus entryfindings/findings report
CI, releases, maintenance.github/workflows/infrastructure, maintenance, protocol upgrade runbook, security policy

Infrastructure and privacy

shapekit collects no telemetry. The few commands that use the network, and everything the project runs on, are listed in Infrastructure.

Maintenance

Maintained by Eren Topal through the first protocol upgrade after delivery (protocol 31). The upgrade runbook is already rehearsed against protocol 31 with core's next-protocol build; the outputs are in next/. The rules for changes, triage and how SDKs pin corpus releases, and the rehearsal, are in Maintenance.

License

Apache License 2.0, see LICENSE and NOTICE.

All pages

Adding a shape

How to add a shape family to the corpus and generate its core-emitted entries.

Adapter interface

The replay harness (shapekit harness run) feeds recorded chains to an indexer and checks what the indexer stored against the meta oracle.

Connecting a PostgreSQL indexer with a mapping file

The replay harness talks to an indexer through an adapter (adapter-interface.md).

Replay server

shapekit serve replays one recorded chain over HTTP.

Running the corpus in an indexer's CI

An indexer repository replays the chains of a pinned shapekit corpus release into the indexer it builds, on every pull request, and gets the harness verdicts for each corpus entry.

Testee protocol

A testee is a small program that wraps one Stellar SDK at one exact version and answers requests from the conformance runner (shapekit conformance run).

Running the corpus in an SDK's CI

An SDK repository runs the shapekit corpus against the SDK version it builds, on every pull request, with a pinned corpus release and its own list of known failures.

Seeded faults

shapekit conformance seed-check measures how much of an SDK's behaviour the corpus actually watches.

Reading a run: shapekit report

shapekit report turns one harness run or one conformance run into a single HTML page you can open from disk, attach to an issue or keep as a CI artifact.

indexerlint

indexerlint checks Go indexer code built on github.com/stellar/go-stellar-sdk for the three ingestion mistakes the indexer-hardening guide describes.

Indexer Hardening

Which transaction fields stellar-core validates and which it passes through, depth and size caps for decoding ledger data, deriving participants from meta, and storing muxed and signed-payload addresses.

Infrastructure

Everything shapekit's deliverables run on, what they talk to, and what they record about you (nothing).

Maintenance

This page says who maintains shapekit, for how long, and the rules every change follows.

Protocol upgrade runbook

The steps for taking shapekit to a new Stellar protocol version.

Differential fuzzing

shapekit fuzz feeds generated and mutated XDR values through two decoders and reports every input on which they disagree.

The website

The shapekit.org website is built from site/.

On this page