Skip to content

feat(grpc): implement internal microservice gRPC communication with m… - #1980

Open
Dev-Savio-hub wants to merge 1 commit into
StellarDevHub:mainfrom
Dev-Savio-hub:feat/be-093-grpc-mtls
Open

Dev-Savio-hub wants to merge 1 commit into
StellarDevHub:mainfrom
Dev-Savio-hub:feat/be-093-grpc-mtls

Conversation

@Dev-Savio-hub

Copy link
Copy Markdown

this pr closes #1840

Summary

Resolves BE-093: Microservice gRPC Communication Channel with Mutual TLS (mTLS) Authentication.

Replaces unauthenticated internal HTTP communication between the API gateway, Soroban indexer service, and WASM evaluation workers with high-speed Protocol Buffer gRPC channels authenticated via strict bidirectional mutual TLS (mTLS).

Key Changes

  • Protobuf Schema: Added backend/src/grpc/proto/internal.proto and indexer/proto/internal.proto defining IndexerService (GetEvents, GetCursor, HealthCheck) and WasmEvaluatorService (ExecuteWasm, HealthCheck).
  • mTLS & Internal PKI: Added backend/src/grpc/mtls.ts (strict checkClientCertificate = true server credentials, mTLS client credentials, env/file loaders, and programmatic X.509 v3 CA/service cert generator) and scripts/generate-mtls-certs.sh for generating internal CA and service certificates (api-gateway, indexer, wasm-worker).
  • Backend gRPC Server & Clients: Added WasmWorkerGrpcServer, WasmEvaluatorGrpcClient, IndexerGrpcClient, and protoLoader in backend/src/grpc/.
  • WASM Sandbox Integration: Added executeWasmWithTransport in backend/src/services/wasmExecutionSandbox.ts to dispatch WASM evaluation over mTLS gRPC when a remote worker client is supplied.
  • Rust Indexer mTLS gRPC Server: Added tonic/prost mTLS gRPC server (indexer/src/grpc.rs, indexer/build.rs, indexer/src/config.rs, indexer/src/main.rs) enforcing ServerTlsConfig::client_ca_root bidirectional certificate verification.
  • Tests: Added backend/tests/mtlsGrpc.test.ts verifying mTLS authentication, transport-layer rejection of plaintext/one-way TLS/untrusted CA clients, and >3x Protobuf serialization throughput compared to JSON.

Verification

  • npx jest tests/mtlsGrpc.test.ts --runInBand --forceExit: 5 passed, 5 total.

@vercel

vercel Bot commented Nov 24, 2026

Copy link
Copy Markdown

@Dev-Savio-hub is attempting to deploy a commit to the Ayomide Adeniran's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Nov 24, 2026

Copy link
Copy Markdown

@Dev-Savio-hub Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

This branch has not been deployed

No deployments
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.

[BE-093] Microservice gRPC Communication Channel with Mutual TLS (mTLS) Authentication

1 participant