Repository navigation
Bump RPC OpenRPC info.version to 27.1.1 and fix request/response type drift - #2669
Merged
Merged
Conversation
) Bump the hardcoded info.version in openrpc/scripts/build.mjs from 20.1.0 to 27.1.1 (current stellar-rpc release) and regenerate the spec. Also audited every method's request/response types against the canonical Go structs in go-stellar-sdk/protocols/rpc (the package stellar-rpc v27.1.1 pins), and fixed the confirmed drift: - getTransaction: add always-present txHash; latestLedgerCloseTime, oldestLedgerCloseTime and createdAt are JSON strings on the wire (Go `,string`), not numbers — typed inline as string (the shared number schemas are left intact for getTransactions/getLedgers, which encode as numbers) - getTransactions: add per-transaction txHash (Transactions schema) - getEvents: add always-present oldestLedger, latestLedgerCloseTime and oldestLedgerCloseTime (the close times are string-encoded) - getHealth: add latestLedgerCloseTime and oldestLedgerCloseTime (string) - getLatestLedger: add protocolVersion - getFeeStats: transactionCount is string-encoded (Go `,string`), not number - getLedgers: drop the contradictory number $ref on the string ledgerCloseTime - getVersionInfo: fix the example's stale snake_case keys to match the schema Verified with pnpm rpcspec:validate. Not included (intentionally out of scope, flagged for follow-up): the `xdrFormat: "json"` response variants (topicJson, valueJson, envelopeJson, resultJson, transactionDataJson, etc.), getLedgerEntries extXdr, the simulateTransaction useUpgradedAuth param, and various optional/required nuances — these are a larger, separate documentation-scope decision that overlaps the ongoing spec-sync tracked in #949. Closes #2581 Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the Stellar RPC OpenRPC spec to v27.1.1 and aligns response types with the pinned Go protocol structs.
Changes:
- Bumps the generated specification version.
- Corrects transaction, ledger, event, health, fee, and version schemas.
- Regenerates the published OpenRPC document.
Recommendation: NEEDS-CHANGES — correct the getLatestLedger protocol example and update stale event and transaction examples.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
openrpc/scripts/build.mjs |
Bumps the RPC version. |
openrpc/src/stellar-rpc/schemas/Transactions.json |
Adds transaction hashes. |
openrpc/src/stellar-rpc/schemas/Ledgers.json |
Corrects close-time typing. |
openrpc/src/stellar-rpc/schemas/FeeDistribution.json |
Corrects transaction-count typing. |
openrpc/src/stellar-rpc/methods/getVersionInfo.json |
Fixes example field names. |
openrpc/src/stellar-rpc/methods/getTransaction.json |
Corrects response fields and types. |
openrpc/src/stellar-rpc/methods/getLatestLedger.json |
Adds the protocol version. |
openrpc/src/stellar-rpc/methods/getHealth.json |
Adds ledger close times. |
openrpc/src/stellar-rpc/methods/getEvents.json |
Adds ledger-range metadata. |
static/stellar-rpc.openrpc.json |
Regenerates the published specification. |
Address Copilot review by making the examples consistent with the updated schema, refreshing from live testnet (soroban-testnet.stellar.org) where practical: - getEvents: rebuilt both example results from real testnet responses so they include the always-present oldestLedger / latestLedgerCloseTime / oldestLedgerCloseTime fields; the event items now also match the current Event schema (operationIndex/transactionIndex, no stale pagingToken) - getTransaction: NOT_FOUND example now includes txHash (echoes the requested hash), satisfying the newly-required field - getLatestLedger: example protocolVersion set to 24 to match the checked-in protocol-24 header/metadata blobs (kept compact — see PR note) - getHealth, getVersionInfo, getFeeStats: refreshed example values from live testnet (protocol 27, current commit/build, string transactionCount) Regenerated static/stellar-rpc.openrpc.json; pnpm rpcspec:validate passes (examples now validate against the schemas). Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
…review) Per maintainer request, make the getLatestLedger example protocol 27 (not the older protocol-24 capture). Since current testnet ledgers all carry sizable metadata, this uses the smallest recent real ledger so id/protocolVersion/ sequence/closeTime/headerXdr/metadataXdr are all internally consistent and current. Regenerated static spec; rpcspec:validate passes. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
The real protocol-27 LedgerCloseMeta is ~63KB of base64; keep the example compact by truncating metadataXdr with an explicit marker. headerXdr is small and left intact. rpcspec:validate still passes (value is a string). Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
2 similar comments
Shaptic
approved these changes
Jul 21, 2026
Shaptic
left a comment
Contributor
There was a problem hiding this comment.
This is fire 🙏 thank you for checking our work heh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2581. Bumps the hardcoded
info.versioninopenrpc/scripts/build.mjsfrom20.1.0to27.1.1(current stellar-rpc release) and regenerates the spec.Also audited every method's request/response types against the canonical Go structs in
go-stellar-sdk/protocols/rpc— the packagestellar-rpcv27.1.1 pins — and fixed the confirmed drift.Version bump
build.mjs:20.1.0→27.1.1; regeneratedstatic/stellar-rpc.openrpc.json.Type-accuracy fixes (verified against v27.1.1 source)
txHash;latestLedgerCloseTime/oldestLedgerCloseTime/createdAtare JSON strings on the wire (Go,string), not numbers — typed inline asstringtxHasholdestLedger,latestLedgerCloseTime,oldestLedgerCloseTime(close times string-encoded)latestLedgerCloseTime+oldestLedgerCloseTime(string)protocolVersiontransactionCountis string-encoded (Go,string), was typed numbernumber$refon thestringledgerCloseTimeNote on the close-time types:
getTransaction/getEvents/getHealthserialize their close-time fields as JSON strings (,string), whilegetTransactions/getLedgerstop-level timestamps are numbers. These previously shared the same numeric schema; the string cases are now typed inline so the shared numeric schemas stay correct for the number cases.Validated with
pnpm rpcspec:validate.Intentionally out of scope (flagged for follow-up)
The audit also surfaced a systematic gap that is a larger documentation-scope decision, left out of this PR (overlaps the ongoing spec-sync in #949):
xdrFormat: "json"response variants across every method (topicJson,valueJson,envelopeJson,resultJson,resultMetaJson,diagnosticEventsJson,transactionDataJson,eventsJson,returnValueJson,authJson,keyJson,dataJson,beforeJson,afterJson,headerJson,metadataJson,extJson) — the spec currently documents only the base64 (*Xdr) forms;getLedgerEntriesextXdrextension field;simulateTransactionuseUpgradedAuthrequest param (marked transitional/deprecated in Go);diagnosticvalue on the getEventstypeenum.Happy to take the
*Jsonvariants as a dedicated follow-up if we want to document that format.Closes #2581
🤖 Generated with Claude Code