Skip to content

feat: implement getVersionInfo and getFeeStats#34

Open
RaoulSchaffranek wants to merge 3 commits into
mainfrom
feat/get-version-info-fee-stats
Open

feat: implement getVersionInfo and getFeeStats#34
RaoulSchaffranek wants to merge 3 commits into
mainfrom
feat/get-version-info-fee-stats

Conversation

@RaoulSchaffranek

Copy link
Copy Markdown
Member

What

Adds the two parameterless read-only RPC methods from the Stellar RPC spec:

  • getVersionInfo returns version (the komet-node package version), commitHash and buildTimestamp (all-zeros / epoch placeholders — komet-node is a Python package, so nothing is baked in at build time), captiveCoreVersion (the komet package, i.e. the K semantics of Soroban that execute the transactions), and protocolVersion 22 as a JSON number.
  • getFeeStats returns constant fee distributions for sorobanInclusionFee and inclusionFee — komet-node has no fee market, so every statistic is the 100-stroop network minimum over an empty sample (transactionCount: "0", ledgerCount: 0) — plus latestLedger read live from metadata.json.

Why

Spec compliance: both methods are part of the protocol-22 RPC surface (see the OpenRPC spec for getVersionInfo and getFeeStats) and were previously answered with -32601 Method not found. Wire types follow what real stellar-rpc emits: protocolVersion is a number (a Go uint32), and every FeeDistribution field except ledgerCount uses Go's ,string encoding, i.e. JSON strings holding decimal numbers.

How

Follows the existing architecture: dispatch and response formatting live in the K semantics (src/komet_node/kdist/node.md); server.py only injects the version strings into the request envelope, since package metadata lives on the Python side and K cannot read it. Docs updated accordingly (docs/server.md, docs/node-semantics.md, docs/architecture.md, docs/notes.md).

Testing

New integration tests in src/tests/integration/test_server.py check the exact key sets and JSON types of both responses, that omitting params works (both methods take no parameters), and that getFeeStats.latestLedger tracks the chain across transactions. Full test_server.py passes (30 tests), and flake8/isort/black are clean.

Cover the wire format of real stellar-rpc (protocol 22): getVersionInfo
returns exactly version/commitHash/buildTimestamp/captiveCoreVersion/
protocolVersion with protocolVersion as a JSON number, and getFeeStats
returns both FeeDistribution objects (fee values and transactionCount as
decimal strings, ledgerCount as a number) plus a live latestLedger number.
Both methods take no parameters. The tests currently fail with -32601
since neither method is implemented yet.
Add the two parameterless read-only methods per the Stellar RPC spec.
getVersionInfo reports the komet-node package version, all-zeros commit
hash and epoch build timestamp (nothing is baked in at build time), the
komet package as the Captive Core, and protocolVersion 22 as a JSON
number. getFeeStats returns constant fee distributions (there is no fee
market; every statistic is the 100-stroop network minimum over an empty
sample) with the stellar-rpc wire types — all fields except ledgerCount
as decimal strings — and a live latestLedger number from metadata.json.

Dispatch and response formatting live in node.md; server.py only
supplies the version strings, which come from Python package metadata
that K cannot read.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant