From 5daf8996e7232dca816d32ac803f1dfb89e8dee2 Mon Sep 17 00:00:00 2001 From: Siddharth Suresh Date: Fri, 5 Jun 2026 11:36:02 -0700 Subject: [PATCH 1/4] Pin go-stellar-sdk to the CAP-71 Go XDR build (a8d5b306) The released SDK v0.4.0 predates CAP-0071: it lacks the new XDR (SorobanCredentialsAddressWithDelegates, SorobanDelegateSignature, etc.) and the ledgerbackend GetLedgerRaw API. Pin the protocol-27 XDR build via the sisuresh/go replace until go-stellar-sdk#5945 is released. Also transitively bumps stellar/go-xdr to 0bf8f49 (#32), raising DecodeDefaultMaxDepth 250 -> 1500 so deep CAP-71 delegate chains decode. --- go.mod | 4 +++- go.sum | 8 ++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/go.mod b/go.mod index 95a03caba..cf09be49e 100644 --- a/go.mod +++ b/go.mod @@ -117,7 +117,7 @@ require ( github.com/spf13/afero v1.10.0 // indirect github.com/spf13/cast v1.5.1 // indirect github.com/spf13/viper v1.17.0 // indirect - github.com/stellar/go-xdr v0.0.0-20260312225820-cc2b0611aabf // indirect + github.com/stellar/go-xdr v0.0.0-20260529210834-0bf8f4956364 // indirect github.com/stretchr/objx v0.5.3 // indirect github.com/subosito/gotenv v1.6.0 // indirect go.opencensus.io v0.24.0 // indirect @@ -148,3 +148,5 @@ require ( gopkg.in/tylerb/graceful.v1 v1.2.15 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) + +replace github.com/stellar/go-stellar-sdk => github.com/sisuresh/go v0.0.0-20260603235145-a8d5b3066361 diff --git a/go.sum b/go.sum index 277c5e06d..1b5590a18 100644 --- a/go.sum +++ b/go.sum @@ -415,6 +415,8 @@ github.com/sergi/go-diff v1.3.1 h1:xkr+Oxo4BOQKmkn/B9eMK0g5Kg/983T9DqqPHwYqD+8= github.com/sergi/go-diff v1.3.1/go.mod h1:aMJSSKb2lpPvRNec0+w3fl7LP9IOFzdc9Pa4NFbPK1I= github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= +github.com/sisuresh/go v0.0.0-20260603235145-a8d5b3066361 h1:bxhnsDgD58Q8H/smlFqBN6dpYiDA/f1X3kWOTRBEM5c= +github.com/sisuresh/go v0.0.0-20260603235145-a8d5b3066361/go.mod h1:IkcqcrE9UQi7n/1y+MxKB+7qzdjG1T2kGOD7Ss8dqjw= github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo= github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0= github.com/spf13/afero v1.10.0 h1:EaGW2JJh15aKOejeuJ+wpFSHnbd7GE6Wvp3TsNhb6LY= @@ -429,10 +431,8 @@ github.com/spf13/viper v1.17.0 h1:I5txKw7MJasPL/BrfkbA0Jyo/oELqVmux4pR/UxOMfI= github.com/spf13/viper v1.17.0/go.mod h1:BmMMMLQXSbcHK6KAOiFLz0l5JHrU89OdIRHvsk0+yVI= github.com/spiffe/go-spiffe/v2 v2.6.0 h1:l+DolpxNWYgruGQVV0xsfeya3CsC7m8iBzDnMpsbLuo= github.com/spiffe/go-spiffe/v2 v2.6.0/go.mod h1:gm2SeUoMZEtpnzPNs2Csc0D/gX33k1xIx7lEzqblHEs= -github.com/stellar/go-stellar-sdk v0.4.0 h1:WBLeJk7EllU7WhwrTH1L5Mu2EhZor/xy5sVi/82JzNQ= -github.com/stellar/go-stellar-sdk v0.4.0/go.mod h1:tLKAQPxa2I5UvGMabBbUXcY3fmgYnfDudrMeK7CDX4w= -github.com/stellar/go-xdr v0.0.0-20260312225820-cc2b0611aabf h1:GY1RVbX3Hg7poPXEf6yojjP0hyypvgUgZmCqQU9D0xg= -github.com/stellar/go-xdr v0.0.0-20260312225820-cc2b0611aabf/go.mod h1:If+U9Z1W5xU97VrOgJandQT+2dN7/iOpkCrxBJEyF80= +github.com/stellar/go-xdr v0.0.0-20260529210834-0bf8f4956364 h1:gOKrfuWdZ92LFlv0TAwgZ7OsWKeBsOMDlGLyFgduI1w= +github.com/stellar/go-xdr v0.0.0-20260529210834-0bf8f4956364/go.mod h1:If+U9Z1W5xU97VrOgJandQT+2dN7/iOpkCrxBJEyF80= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= From cd3a67cbbd12e922bda33bedf0e2aadfe325e421 Mon Sep 17 00:00:00 2001 From: Siddharth Suresh Date: Fri, 5 Jun 2026 11:11:02 -0700 Subject: [PATCH 2/4] Implement GetLedgerRaw on rpcdatastore mockLedgerBackend The SDK's ledgerbackend.LedgerBackend interface gained GetLedgerRaw; fixes the golangci-lint typecheck failure. --- .../internal/rpcdatastore/ledger_reader_test.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cmd/stellar-rpc/internal/rpcdatastore/ledger_reader_test.go b/cmd/stellar-rpc/internal/rpcdatastore/ledger_reader_test.go index 3cf965de7..aaf86c6ee 100644 --- a/cmd/stellar-rpc/internal/rpcdatastore/ledger_reader_test.go +++ b/cmd/stellar-rpc/internal/rpcdatastore/ledger_reader_test.go @@ -28,6 +28,14 @@ func (m *mockLedgerBackend) GetLedger(ctx context.Context, seq uint32) (xdr.Ledg return args.Get(0).(xdr.LedgerCloseMeta), args.Error(1) //nolint:forcetypeassert } +func (m *mockLedgerBackend) GetLedgerRaw(ctx context.Context, seq uint32) ([]byte, error) { + args := m.Called(ctx, seq) + if v := args.Get(0); v != nil { + return v.([]byte), args.Error(1) //nolint:forcetypeassert + } + return nil, args.Error(1) +} + func (m *mockLedgerBackend) PrepareRange(ctx context.Context, r ledgerbackend.Range) error { args := m.Called(ctx, r) return args.Error(0) From a9d8169c9e315fbb83e699af19d6b008d9e9ed82 Mon Sep 17 00:00:00 2001 From: Siddharth Suresh Date: Fri, 5 Jun 2026 11:40:24 -0700 Subject: [PATCH 3/4] check-dependencies: honor Go SDK replace directives MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Go/Rust XDR revision comparison fetched xdr_commit_generated.txt from stellar/go-stellar-sdk at the required version, ignoring any replace directive. With the SDK replaced by the CAP-71 fork build, the check compared the stale v0.4.0 XDR (cff714a5) instead of the actual one (68fa1ac, matching rust stellar-xdr 27.0.0) and failed spuriously — the same mismatch that was already failing on protocol-next (#761). Resolve the module through the replace so the check validates what is actually built. --- scripts/check-dependencies.bash | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/check-dependencies.bash b/scripts/check-dependencies.bash index 83c93180e..a7ef5521a 100755 --- a/scripts/check-dependencies.bash +++ b/scripts/check-dependencies.bash @@ -82,10 +82,12 @@ done # Now, lets compare the Rust and Go XDR revisions # TODO: The sed extraction below won't work for version tags -GO_XDR_REVISION=$(go list -m -f '{{.Version}}' github.com/stellar/go-stellar-sdk | $SED 's/.*-\(.*\)/\1/') +# Honor a `replace` directive for the Go SDK (e.g. a fork carrying unreleased XDR). +GO_SDK_REPO=$(go list -m -f '{{if .Replace}}{{.Replace.Path}}{{else}}{{.Path}}{{end}}' github.com/stellar/go-stellar-sdk) +GO_XDR_REVISION=$(go list -m -f '{{if .Replace}}{{.Replace.Version}}{{else}}{{.Version}}{{end}}' github.com/stellar/go-stellar-sdk | $SED 's/.*-\(.*\)/\1/') # revision of https://github.com/stellar/stellar-xdr/ used by the Go code -STELLAR_XDR_REVISION_FROM_GO=$($CURL https://raw.githubusercontent.com/stellar/go-stellar-sdk/${GO_XDR_REVISION}/xdr/xdr_commit_generated.txt) +STELLAR_XDR_REVISION_FROM_GO=$($CURL https://raw.githubusercontent.com/${GO_SDK_REPO#github.com/}/${GO_XDR_REVISION}/xdr/xdr_commit_generated.txt) if [ "$STELLAR_XDR_REVISION_FROM_GO" != "$STELLAR_XDR_REVISION_FROM_RUST" ]; then echo "Go and Rust dependencies are using different revisions of https://github.com/stellar/stellar-xdr" From 030e852dccb46745e3d9263a1f7b6472d5f42207 Mon Sep 17 00:00:00 2001 From: Siddharth Suresh Date: Fri, 5 Jun 2026 11:48:46 -0700 Subject: [PATCH 4/4] golangci: allow the temporary go-stellar-sdk replace directive gomoddirectives rejects all replace directives by default; allow the CAP-71 Go XDR pin until go-stellar-sdk#5945 is released. --- .golangci.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.golangci.yml b/.golangci.yml index d5155295d..1b2b2f03d 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -39,6 +39,11 @@ linters: funlen: lines: 100 statements: 50 + gomoddirectives: + # Temporary pin of the CAP-71 (protocol 27) Go XDR build; remove once + # go-stellar-sdk#5945 is released and the replace directive is dropped. + replace-allow-list: + - github.com/stellar/go-stellar-sdk misspell: locale: US testifylint: