Add +rpc cabal flag to gate gRPC dependencies

Aperta
#1,167 2 commenti 0 reazioni 1 assegnatario Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

@carbolymer ci sta già lavorando.

Dal 31/3/2026.

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

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.
Lingua principale
Haskell
Stelle
41
Fork
33
Merge medio
3g 3h
PR unite (30g)
15

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di IntersectMBO/cardano-api

Tutte le issue di IntersectMBO/cardano-api

Issue simili

Altre issue su Haskell

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.