From 88da7317c23635bdc5b819318b986d9331c34283 Mon Sep 17 00:00:00 2001 From: BabyScope <163932585+BabyScope@users.noreply.github.com> Date: Mon, 14 Sep 2026 07:08:34 +0000 Subject: [PATCH] Add a Rosetta method spec and import it into the cosmos bundle Rosetta is a POST-only HTTP API that a cosmos operator runs beside the node (cosmos/rosetta, since the SDK dropped its in-process implementation in v0.50). Its paths are already expressible in the existing spec format - "POST#/block", "POST#/network/status" - but no spec declares them, so nodecore cannot route to a Rosetta sidecar at all. This adds pkg/methods/specs/rosetta.json: a plain spec on the rest-additional connector, covering the Data API, the Construction API and /search/transactions, modelled on hyperliquid-rest-additional.json. It is imported into the cosmos bundle so every cosmos chain can carry it. An operator opts in per upstream by adding a rest-additional connector pointing at the Rosetta URL; upstreams without one are unaffected, because a method is only dispatchable on a connector the upstream actually declares. rest-additional is excluded from head and internal-request connector selection by IsAdditionalApiConnectorType, so it cannot become an upstream's head connector either. Verified against an Axelar archive: /network/status, /network/list and /block return the node's own Rosetta payloads, while the tendermint methods on the same upstream keep answering unchanged. Historical blocks 1, 100000, 5000000, 15000000, 25000000, 30000000 and 34000000 all resolve, at about 0.11 s per call. --- pkg/methods/specs/cosmos.json | 3 +- pkg/methods/specs/rosetta.json | 160 +++++++++++++++++++++++++++++++++ 2 files changed, 162 insertions(+), 1 deletion(-) create mode 100644 pkg/methods/specs/rosetta.json diff --git a/pkg/methods/specs/cosmos.json b/pkg/methods/specs/cosmos.json index dded63a..64c9c7c 100644 --- a/pkg/methods/specs/cosmos.json +++ b/pkg/methods/specs/cosmos.json @@ -11,6 +11,7 @@ "spec-imports": [ "cosmos-tendermint", "cosmos-rest", - "cosmos-grpc" + "cosmos-grpc", + "rosetta" ] } diff --git a/pkg/methods/specs/rosetta.json b/pkg/methods/specs/rosetta.json new file mode 100644 index 0000000..475ec8e --- /dev/null +++ b/pkg/methods/specs/rosetta.json @@ -0,0 +1,160 @@ +{ + "openrpc": "1.0.0", + "info": { + "title": "Rosetta API methods", + "version": "1.0.0" + }, + "spec": { + "name": "rosetta", + "api-connectors": [ + "rest-additional" + ], + "type": "plain" + }, + "methods": [ + { + "name": "POST#/network/list", + "group": "network", + "params": [], + "settings": { + "cacheable": false + } + }, + { + "name": "POST#/network/status", + "group": "network", + "params": [], + "settings": { + "cacheable": false + } + }, + { + "name": "POST#/network/options", + "group": "network", + "params": [], + "settings": { + "cacheable": false + } + }, + { + "name": "POST#/block", + "group": "block", + "params": [], + "settings": { + "cacheable": false + } + }, + { + "name": "POST#/block/transaction", + "group": "block", + "params": [], + "settings": { + "cacheable": false + } + }, + { + "name": "POST#/account/balance", + "group": "account", + "params": [], + "settings": { + "cacheable": false + } + }, + { + "name": "POST#/account/coins", + "group": "account", + "params": [], + "settings": { + "cacheable": false + } + }, + { + "name": "POST#/mempool", + "group": "mempool", + "params": [], + "settings": { + "cacheable": false + } + }, + { + "name": "POST#/mempool/transaction", + "group": "mempool", + "params": [], + "settings": { + "cacheable": false + } + }, + { + "name": "POST#/construction/derive", + "group": "construction", + "params": [], + "settings": { + "cacheable": false + } + }, + { + "name": "POST#/construction/preprocess", + "group": "construction", + "params": [], + "settings": { + "cacheable": false + } + }, + { + "name": "POST#/construction/metadata", + "group": "construction", + "params": [], + "settings": { + "cacheable": false + } + }, + { + "name": "POST#/construction/payloads", + "group": "construction", + "params": [], + "settings": { + "cacheable": false + } + }, + { + "name": "POST#/construction/parse", + "group": "construction", + "params": [], + "settings": { + "cacheable": false + } + }, + { + "name": "POST#/construction/combine", + "group": "construction", + "params": [], + "settings": { + "cacheable": false + } + }, + { + "name": "POST#/construction/hash", + "group": "construction", + "params": [], + "settings": { + "cacheable": false + } + }, + { + "name": "POST#/construction/submit", + "group": "construction", + "params": [], + "settings": { + "cacheable": false + } + }, + { + "name": "POST#/search/transactions", + "group": "search", + "params": [], + "settings": { + "cacheable": false + } + } + ] +}