Add +rpc cabal flag to gate gRPC dependencies

Open
#1,167 2 comments 0 reactions 1 assignee View on GitHub

Maintainers usually reply within 2 days

@carbolymer is already working on this.

Since Mar 31, 2026.

Assessment

This issue has not been assessed yet.

Description

Summary

The cardano-rpc package introduces new dependencies (grapesy, grpc-spec, proto-lens) that are currently linked into all cardano-node builds, including block producers that will never enable the RPC feature.

A cabal flag (+rpc, off by default) should gate these dependencies so that builds without the flag exclude them entirely.

Motivation

  • Block producer builds should not carry unnecessary dependencies that increase the attack surface and binary size.
  • Operators who want the RPC interface opt in explicitly at build time.
  • This was requested during ADR-018 review.

Proposed approach

  • Add a flag rpc (default: False, manual: True) to cardano-node.cabal.
  • Make build-depends: cardano-rpc conditional on flag(rpc).
  • Guard RPC server startup code in cardano-node behind a CPP conditional (e.g. #ifdef RPC).
  • Document the flag in the README and in ADR-018.

Acceptance criteria

  • cabal build cardano-node (without the flag) does not pull in grapesy, grpc-spec, proto-lens, or cardano-rpc.
  • cabal build cardano-node -f +rpc builds with full RPC support.
  • CI runs builds with and without the flag.
Dominant language
Haskell
Stars
41
Forks
33
Avg merge
3d 3h
Merged PRs (30d)
15

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from IntersectMBO/cardano-api

All issues in IntersectMBO/cardano-api

Similar issues

More Haskell issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.