Skip to content

Add Stellar Service plumbing and GetLedgerEntries,GetLatestLedger#1990

Open
ilija42 wants to merge 6 commits intomainfrom
add-stellar-service
Open

Add Stellar Service plumbing and GetLedgerEntries,GetLatestLedger#1990
ilija42 wants to merge 6 commits intomainfrom
add-stellar-service

Conversation

@ilija42
Copy link
Copy Markdown
Contributor

@ilija42 ilija42 commented Apr 20, 2026

Requires

Supports

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 20, 2026

⚠️ API Diff Results - github.com/smartcontractkit/chainlink-common

⚠️ Breaking Changes (2)

pkg/types.Relayer (1)
  • Stellar — ➕ Added
pkg/types/core.Relayer (1)
  • Stellar — ➕ Added

✅ Compatible Changes (14)

package github (3)
  • com/smartcontractkit/chainlink-common/pkg/chains/stellar — ➕ Added

  • com/smartcontractkit/chainlink-common/pkg/chains/stellar/generate — ➕ Added

  • com/smartcontractkit/chainlink-common/pkg/types/chains/stellar — ➕ Added

pkg/types (2)
  • StellarService — ➕ Added

  • UnimplementedStellarService — ➕ Added

pkg/types.(*UnimplementedRelayer) (1)
  • Stellar — ➕ Added
pkg/types/core/mocks (1)
  • Relayer_Stellar_Call — ➕ Added
pkg/types/core/mocks.(*Relayer) (1)
  • Stellar — ➕ Added
pkg/types/core/mocks.(*Relayer_Expecter) (1)
  • Stellar — ➕ Added
pkg/types/mocks (5)
  • NewStellarService — ➕ Added

  • StellarService — ➕ Added

  • StellarService_Expecter — ➕ Added

  • StellarService_GetLatestLedger_Call — ➕ Added

  • StellarService_GetLedgerEntries_Call — ➕ Added


📄 View full apidiff report

@ilija42 ilija42 marked this pull request as ready for review April 20, 2026 14:52
@ilija42 ilija42 requested review from a team as code owners April 20, 2026 14:52
Copilot AI review requested due to automatic review settings April 20, 2026 14:52
Copy link
Copy Markdown
Contributor

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

This PR adds first-class Stellar support to the relayer plumbing by introducing Stellar domain types, gRPC/proto definitions + converters, and wiring Stellar through the LOOP relayer/relayerset clients and servers.

Changes:

  • Add types.StellarService and expose it via Relayer.Stellar() (plus unimplemented stubs/mocks).
  • Introduce Stellar domain request/response types and a new stellar.proto gRPC service with helper converters.
  • Wire Stellar through LOOP relayer + relayerset client/server plumbing and add round-trip + relayerset integration tests.

Reviewed changes

Copilot reviewed 19 out of 19 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
pkg/types/relayer.go Adds StellarService, Relayer.Stellar(), and an unimplemented Stellar service stub.
pkg/types/core/relayerset.go Extends core relayer interface with Stellar().
pkg/types/core/mocks/relayer.go Adds mock support for Relayer.Stellar().
pkg/types/chains/stellar/stellar.go Introduces Stellar domain types and a minimal Stellar RPC client interface.
pkg/loop/internal/relayerset/stellar.go Adds relayerset-level Stellar gRPC routing (client wrapper + server).
pkg/loop/internal/relayerset/server.go Registers Stellar server within relayerset server plumbing.
pkg/loop/internal/relayerset/relayerset_test.go Adds relayerset integration tests for Stellar service.
pkg/loop/internal/relayerset/relayer.go Exposes Stellar() on relayerset relayer wrapper.
pkg/loop/internal/relayerset/client.go Adds Stellar client plumbing to relayerset client.
pkg/loop/internal/relayer/stellar.go Adds relayer-level Stellar gRPC client/server adapters.
pkg/loop/internal/relayer/stellar_test.go Adds gRPC round-trip tests for Stellar domain types.
pkg/loop/internal/relayer/relayer.go Registers Stellar service on plugin relayer server and exposes client method.
pkg/loop/internal/pb/relayerset/helper.go Registers Stellar server as a relayerset dependant service.
pkg/chains/stellar/stellar.proto Adds Stellar gRPC service + messages.
pkg/chains/stellar/stellar.pb.go Generated proto Go types for Stellar.
pkg/chains/stellar/stellar_grpc.pb.go Generated gRPC Go stubs for Stellar.
pkg/chains/stellar/proto_helpers.go Domain↔proto conversion helpers for Stellar types.
pkg/chains/stellar/generate.go Adds go:generate hook for Stellar proto generation.
pkg/chains/stellar/generate/main.go Adds protoc generation entrypoint for Stellar.

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

Comment thread pkg/chains/stellar/stellar.proto Outdated
Comment thread pkg/loop/internal/relayerset/relayerset_test.go Outdated
Comment thread pkg/loop/internal/relayer/stellar_test.go
@ilija42 ilija42 force-pushed the add-stellar-service branch from 92f5751 to b29dd60 Compare April 20, 2026 15:00
Comment on lines +5 to +9
// XDR is a base64-encoded XDR-serialized value (envelope, data, result, key, etc.).
type XDR string

// LedgerHash is the hex-encoded SHA-256 hash of a Stellar ledger.
type LedgerHash string
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is it important for these to be independent types? I think the extra conversions could be avoided, even just with aliases:

Suggested change
// XDR is a base64-encoded XDR-serialized value (envelope, data, result, key, etc.).
type XDR string
// LedgerHash is the hex-encoded SHA-256 hash of a Stellar ledger.
type LedgerHash string
// XDR is a base64-encoded XDR-serialized value (envelope, data, result, key, etc.).
type XDR = string
// LedgerHash is the hex-encoded SHA-256 hash of a Stellar ledger.
type LedgerHash = string

Comment on lines +12 to +24
// xdrToBytes base64-decodes a domain XDR string to raw binary.
func xdrToBytes(x stellar.XDR) ([]byte, error) {
b, err := base64.StdEncoding.DecodeString(string(x))
if err != nil {
return nil, fmt.Errorf("invalid base64 XDR %q: %w", x, err)
}
return b, nil
}

// bytesToXDR base64-encodes raw binary XDR to the domain type.
func bytesToXDR(b []byte) stellar.XDR {
return stellar.XDR(base64.StdEncoding.EncodeToString(b))
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Would it be cleaner to define these in package stellar? e.g. XDR) ToBytes() ([]byte, error) and stellar.ParseXDR([]byte) 🤷

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.

4 participants