Skip to content

gRPC: Add gRPC interface to cardano-node with tests in cardano-testnet#6273

Open
carbolymer wants to merge 7 commits intomasterfrom
mgalazyn/feature/add-grpc-interface
Open

gRPC: Add gRPC interface to cardano-node with tests in cardano-testnet#6273
carbolymer wants to merge 7 commits intomasterfrom
mgalazyn/feature/add-grpc-interface

Conversation

@carbolymer
Copy link
Contributor

@carbolymer carbolymer commented Jul 4, 2025

Description

This PR adds an experimental gRPC endpoint to cardano-node. You can read architecture design here. For now the following methods are supported:

The gRPC endpoint is disabled by default, can be enabled by CLI flag or by configuration option.

Support for enabling gRPC endpoint is added into cardano-testnet.

Things necessary to do before the merge:

  • Release cardano-cli to remove SRP
  • Release cardano-rpc to remove SRP

Checklist

  • Commit sequence broadly makes sense and commits have useful messages
  • New tests are added if needed and existing tests are updated. These may include:
    • golden tests
    • property tests
    • roundtrip tests
    • integration tests
      See Runnings tests for more details
  • Any changes are noted in the CHANGELOG.md for affected package
  • The version bounds in .cabal files are updated
  • CI passes. See note on CI. The following CI checks are required:
    • Code is linted with hlint. See .github/workflows/check-hlint.yml to get the hlint version
    • Code is formatted with stylish-haskell. See .github/workflows/stylish-haskell.yml to get the stylish-haskell version
    • Code builds on Linux, MacOS and Windows for ghc-9.6 and ghc-9.12
  • Self-reviewed the diff

Note on CI

If your PR is from a fork, the necessary CI jobs won't trigger automatically for security reasons.
You will need to get someone with write privileges. Please contact IOG node developers to do this
for you.

@carbolymer carbolymer self-assigned this Jul 4, 2025
@carbolymer carbolymer changed the title cardano-rpc | Add gRPC interface to cardano-node, add tests to cardano-testnet cardano-rpc | Add gRPC interface to cardano-node with tests in cardano-testnet Jul 4, 2025
@carbolymer carbolymer force-pushed the mgalazyn/feature/add-grpc-interface branch 2 times, most recently from 864cf20 to 12bae80 Compare July 10, 2025 15:37
@carbolymer carbolymer force-pushed the mgalazyn/feature/add-grpc-interface branch from 0004d02 to 2c89086 Compare July 23, 2025 14:20
@carbolymer carbolymer force-pushed the mgalazyn/feature/add-grpc-interface branch 3 times, most recently from aaab28c to eab2ed1 Compare July 25, 2025 16:57
@palas palas force-pushed the mgalazyn/feature/add-grpc-interface branch 4 times, most recently from 4d19d4c to 98d8073 Compare August 3, 2025 20:00
@carbolymer carbolymer force-pushed the mgalazyn/feature/add-grpc-interface branch from 12d7ab5 to 73c37e6 Compare September 4, 2025 16:45
@carbolymer carbolymer force-pushed the mgalazyn/feature/add-grpc-interface branch from 8cbf3f2 to 0ec9ea7 Compare October 2, 2025 12:29
@carbolymer carbolymer changed the title cardano-rpc | Add gRPC interface to cardano-node with tests in cardano-testnet gRPC: Add gRPC interface to cardano-node with tests in cardano-testnet Nov 13, 2025
@carbolymer carbolymer force-pushed the mgalazyn/feature/add-grpc-interface branch 2 times, most recently from 7c29f29 to ebf5f8b Compare November 17, 2025 08:33
@carbolymer carbolymer force-pushed the mgalazyn/feature/add-grpc-interface branch 2 times, most recently from a8564a9 to 5d772e5 Compare November 28, 2025 20:50
@carbolymer carbolymer force-pushed the mgalazyn/feature/add-grpc-interface branch from 5d772e5 to 450a849 Compare January 7, 2026 18:51
@carbolymer carbolymer force-pushed the mgalazyn/feature/add-grpc-interface branch 6 times, most recently from 86ec635 to 9984a35 Compare February 24, 2026 17:13
@carbolymer carbolymer requested a review from Copilot February 24, 2026 17:13

This comment was marked as outdated.

@carbolymer carbolymer force-pushed the mgalazyn/feature/add-grpc-interface branch 4 times, most recently from 7b30930 to 8e67434 Compare February 26, 2026 14:55
@carbolymer carbolymer changed the title WIP: gRPC: Add gRPC interface to cardano-node with tests in cardano-testnet gRPC: Add gRPC interface to cardano-node with tests in cardano-testnet Mar 2, 2026
@carbolymer carbolymer force-pushed the mgalazyn/feature/add-grpc-interface branch 3 times, most recently from 2ea442d to 8f6a3b7 Compare March 9, 2026 16:26

This comment was marked as outdated.

This comment was marked as outdated.

This comment was marked as outdated.

Copy link
Contributor

@Jimbo4350 Jimbo4350 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor comments but I would solicit feedback from @jasagredo regarding the configuration change. Will approve after that is discussed.

, pncResponderCoreAffinityPolicy :: !(Last ResponderCoreAffinityPolicy)

-- gRPC
, pncRpcConfig :: !PartialRpcConfig
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here regarding the configuration being moved to consensus.

, ncResponderCoreAffinityPolicy :: ResponderCoreAffinityPolicy

-- gRPC
, ncRpcConfig :: RpcConfig
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm. @jasagredo is working on moving the cardano node configuration machinery to ouroboros-consensus. To prevent future pain I would run this change by him.

mconcat $
("reason" .= prettyShow tr)
: case tr of
TraceRpcFatalError _ -> ["kind" .= String "FatalError"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where can one see the reason for the fatal error?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's above in line 29. I've made reason dumped for each trace.

In general, this is used for any initialisation exception: https://github.com/IntersectMBO/cardano-api/blob/2aa5ce77b1139d1d216c19eb4eb7b7a7e0e4e18b/cardano-rpc/src/Cardano/Rpc/Server.hs#L71

---------------------------
-- Test readParams response
---------------------------
pparamsResponse ^. U5c.ledgerTip . U5c.slot === slot
Copy link
Contributor

@Jimbo4350 Jimbo4350 Mar 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How flaky is this test?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have not observed flakiness. This test also runs with 2 retries, so if this happens, it should rerun. We could call cli and get the tip in parallel, but I'm not sure the gain here will be worth of complexity.


txBody <- H.leftFail $ createTransactionBody sbe content

let signedTx = signShelleyTransaction sbe txBody [wit0]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see we are using the "old" api. Fine for this PR but I'd like you to migrate to the new api if possible in a follow up PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 33 out of 34 changed files in this pull request and generated 5 comments.

Comments suppressed due to low confidence (1)

nix/pkgs.nix:1

  • previousAttrs.buildInputs is not guaranteed to exist on all derivations; if it's missing, Nix evaluation will fail. Safer pattern is to append to (previousAttrs.buildInputs or []) before adding prev.windows.pthreads.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

4 participants