Skip to content

xdr: compare assets by their XDR encoding, and use Equals for asset equality - #5974

Merged
karthikiyer56 merged 7 commits into
mainfrom
fix/asset-ordering-and-pool-leg-selection
Aug 6, 2026
Merged

xdr: compare assets by their XDR encoding, and use Equals for asset equality#5974
karthikiyer56 merged 7 commits into
mainfrom
fix/asset-ordering-and-pool-leg-selection

Conversation

@karthikiyer56

@karthikiyer56 karthikiyer56 commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Root cause

Asset.LessThan compared issuers as base32 G... strkey text. The ordering the protocol uses is the one implied by the XDR encoding, which compares the raw 32-byte issuer key.

The base32 alphabet runs A-Z then 2-7, so a larger 5-bit group can encode to a smaller ASCII character — sorting strkeys as text does not sort the underlying keys. Roughly 8% of same-code issuer pairs order differently under the two rules. The asset type and code steps already matched, since GetCode() returns the full NUL-padded fixed-width array, so only the issuer comparison changes.

LessThan now compares the asset type, the NUL-padded code bytes, and the raw issuer key — the same fields, in the same order, that the XDR encoding compares. A property test pins it to the marshalled-XDR ordering.

Changes

Location Before After
xdr/asset.goLessThan issuer compared as strkey text compares type, code bytes, raw issuer key (the XDR order)
xdr/pool_id.goNewPoolId b.LessThan(a), so identical assets passed !a.LessThan(b) — strict, rejects reversed and identical
txnbuild/liquidity_pool_parameters.goToXDR no ordering check, emitted any order rejects unless AssetA < AssetB
txnbuild/liquidity_pool_id.go, _deposit.go, _withdraw.go lenient b.LessThan(a) check, AssetA must be <= AssetB error strict AssetA < AssetB, checked after XDR conversion
txnbuild/asset.goNativeAsset.LessThan true even against another native strict: !other.IsNative()
txnbuild/helpers.govalidateChangeTrustAsset returned nil early for pool shares validates the asset pair
processors/token_transfer assetInCb == lp.assetA — pointer identity assetInCb.Equals(lp.assetA) — by value

Consequences of the old behaviour, all fixed here:

  • NewPoolId could reject valid pairs and accept invalid ones, so a pool id could not always be derived.
  • A pair of two identical assets was accepted, since neither is less than the other. The protocol requires AssetA < AssetB strictly.
  • txnbuild could emit ChangeTrust pool parameters the SDK cannot read back.
  • Trustline revocation picked the wrong liquidity pool leg to burn, because xdr.Asset holds its alphanum arms as pointers and == is false for two separately decoded copies of the same asset.

Changelog entries for the breaking changes are in CHANGELOG.md and txnbuild/CHANGELOG.md.

Tests

New property and fixed-vector tests pin LessThan to the XDR encoding, cover the reversed and identical-asset pairs, and assert that anything txnbuild builds is readable back by xdr.NewPoolId — the read-back property test now also asserts that exactly one order of each pair builds.

Token transfer fixtures built ledger entries from shared package-level asset vars, so copies aliased the same pointer and == held in tests where it would not in production. Transaction meta now round-trips through XDR in the test runner, which required setting the LedgerKey discriminant in two removed-entry fixture helpers that could not be XDR-encoded at all. Reverting the Equals change now fails the existing revocation test.

Dependency bump (separate commit)

go-xdr moves to v0.0.0-20260806060815-dc590f17552a, picking up stellar/go-xdr#34: a variable-length field whose 4-byte length prefix sits at the end of the input no longer loses both its schema bound and its input-length bound. Every generated type decodes through go-xdr's Decoder, so it applies to all Stellar XDR the SDK reads. Unrelated to the ordering fix — happy to split it out if preferred.

Flaky test (separate commit)

Fixes #5882. The producer now also closes its datastore and propagates the PrepareRange error.

Copilot AI balanced review requested due to automatic review settings August 6, 2026 03:27

Copilot AI left a comment

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.

Pull request overview

Aligns asset ordering with protocol XDR encoding and fixes liquidity-pool leg selection.

Changes:

  • Compares assets using marshalled XDR bytes.
  • Validates liquidity-pool asset ordering.
  • Selects revoked pool legs by index and improves fixture realism.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
xdr/asset.go Implements XDR-based ordering.
xdr/asset_ordering_test.go Tests ordering behavior.
txnbuild/liquidity_pool_parameters.go Validates pool ordering.
txnbuild/liquidity_pool_ordering_test.go Tests pool parameter ordering.
txnbuild/helpers.go Validates pool-share parameters.
processors/token_transfer/token_transfer_processor.go Selects pool legs by index.
processors/token_transfer/token_transfer_processor_test.go Re-encodes metadata in fixtures.

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

Comment thread txnbuild/liquidity_pool_parameters.go Outdated
@karthikiyer56
karthikiyer56 force-pushed the fix/asset-ordering-and-pool-leg-selection branch from f7e7bea to 0902b55 Compare August 6, 2026 05:02
@karthikiyer56 karthikiyer56 changed the title xdr: compare assets by their XDR encoding, and select pool legs by index xdr: compare assets by their XDR encoding, and use Equals for asset equality Aug 6, 2026
@karthikiyer56
karthikiyer56 requested a balanced review from Copilot August 6, 2026 05:16

Copilot AI left a comment

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.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated no new comments.

Suppressed comments (2)

txnbuild/liquidity_pool_parameters.go:35

  • This only rejects the reverse ordering. If AssetA and AssetB are equal, both LessThan calls are false, so ToXDR still emits parameters that violate the XDR contract assetA < assetB (xdr/xdr_generated.go:7329). Check the required forward relation instead so identical assets are rejected too.
	if xdrAssetB.LessThan(xdrAssetA) {
		return xdr.LiquidityPoolParameters{}, errors.New("AssetA must be < AssetB")

processors/token_transfer/token_transfer_processor_test.go:625

  • The existing runner comment is now attached to reEncodeMeta, leaving runTokenTransferEventTests undocumented and giving reEncodeMeta two conflicting descriptions. Move the runner comment back immediately above the runner function.
// reEncodeMeta round-trips the transaction meta through XDR, so that every
// xdr.Asset inside it is decoded into its own allocation.

…quality

Asset.LessThan compared issuers as base32 "G..." strkeys. The ordering the
protocol uses is the one implied by the XDR encoding, which compares the raw
32-byte issuer key. Those are not the same ordering: the base32 alphabet runs
A-Z then 2-7, so a larger 5-bit group can encode to a smaller ASCII character,
and sorting strkeys as text does not sort the underlying keys. Around 8% of
same-code issuer pairs order differently under the two rules.

It now compares the marshalled XDR, which is the ordering by definition. The
asset type and code steps already matched, since GetCode returns the full
NUL-padded fixed-width array.

Three consequences of the old behaviour are also fixed:

  - xdr.NewPoolId could reject correctly-ordered asset pairs and accept
    incorrectly-ordered ones, so a pool id could not always be derived for a
    valid pair.

  - Both xdr.NewPoolId and txnbuild accepted a pair made of two identical
    assets, since neither asset is less than the other. The protocol requires
    AssetA < AssetB strictly, so both now check the forward relation.

  - txnbuild could emit ChangeTrust pool parameters in an order the SDK cannot
    read back. Validate() returned early for pool share assets and
    LiquidityPoolParameters.ToXDR passed both assets through unchecked, so the
    ordering is now enforced in ToXDR, covering every caller that emits pool
    parameters.

Separately, the token transfer processor compared assets with
`assetInCb == lp.assetA` when selecting which liquidity pool leg was burned.
xdr.Asset holds its alphanum arms as pointers, so == compares pointer identity
and is false for two separately decoded copies of the same asset. It now uses
Asset.Equals, which compares by value.

The token transfer fixtures built ledger entries from shared package-level
asset variables, so copies aliased the same pointer and == held in tests where
it would not in production. Transaction meta now round-trips through XDR in the
test runner. This also required setting the LedgerKey discriminant in two
removed-entry fixture helpers, which could not be XDR-encoded at all.

Note for consumers: txnbuild.Assets sorts with this comparator, so its order
changes for same-code assets with different issuers.

Co-Authored-By: Claude Opus 5 <[email protected]>
@karthikiyer56
karthikiyer56 force-pushed the fix/asset-ordering-and-pool-leg-selection branch from 0902b55 to e9a39b4 Compare August 6, 2026 05:24
@karthikiyer56
karthikiyer56 requested a review from a team August 6, 2026 05:31
github.com/stellar/go-xdr v0.0.0-20260806060815-dc590f17552a normalizes the
schema bound inside mergeInputLenAndMaxSize, so a variable-length field whose
4-byte length prefix sits at the very end of the input no longer loses both its
schema bound and its input-length bound.

Every generated type in xdr/xdr_generated.go decodes through go-xdr's Decoder,
so this applies to all Stellar XDR the SDK reads.

Co-Authored-By: Claude Opus 5 <[email protected]>
@socket-security

socket-security Bot commented Aug 6, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatedgithub.com/​stellar/​go-xdr@​v0.0.0-20260529210834-0bf8f4956364 ⏵ v0.0.0-20260806060815-dc590f17552a98 +1100100100100

View full report

@karthikiyer56
karthikiyer56 force-pushed the fix/asset-ordering-and-pool-leg-selection branch 2 times, most recently from b488c1a to db8bbf3 Compare August 6, 2026 17:55
…s backend

The test's callback fails on the first ledger, so the producer stops there, but
the mock required a GetFile for every ledger in the range. Whether the backend's
prefetch pool reached the later ledger before the consumer gave up is a
scheduling detail, so the assertion held only some of the time (#5882).
createMockdataStoreRequiring now lets a test say which fetches it guarantees;
the happy-path test still requires all of them.

ApplyLedgerMetadata also never closed the backend, so returning early stranded
one goroutine per configured worker.

Co-Authored-By: Claude Opus 5 <[email protected]>
@karthikiyer56
karthikiyer56 force-pushed the fix/asset-ordering-and-pool-leg-selection branch from db8bbf3 to a793bb4 Compare August 6, 2026 18:00
@karthikiyer56 karthikiyer56 reopened this Aug 6, 2026
Comment thread xdr/asset.go Outdated
Co-Authored-By: Claude Opus 5 <[email protected]>

@urvisavla urvisavla left a comment

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.

A few comments, tiered by severity (P1 = should fix before merge, P3 = whenever convenient).

Comment thread xdr/asset.go Outdated
Comment thread xdr/pool_id.go
Comment thread txnbuild/liquidity_pool_parameters.go
Comment thread ingest/producer.go
Comment thread txnbuild/liquidity_pool_ordering_test.go
karthikiyer56 and others added 2 commits August 6, 2026 13:09
- xdr: compare assets field-wise (type, code bytes, raw issuer key)
  instead of marshalling, removing the swallowed-error path
- txnbuild: require strictly AssetA < AssetB in NewLiquidityPoolId,
  NewLiquidityPoolDeposit, and NewLiquidityPoolWithdraw
- ingest: close the datastore and propagate the PrepareRange error in
  ApplyLedgerMetadata
- txnbuild: assert the ordering property test builds all 2000 pairs
- changelog entries for the breaking changes

Co-Authored-By: Claude Fable 5 <[email protected]>
…r XDR conversion

Two behavior changes beyond the review feedback:

- NativeAsset.LessThan no longer reports a native asset as less than
  another native, restoring the strict-order contract sort.Interface
  expects
- NewLiquidityPoolId converts both assets to XDR before the ordering
  check, so a malformed asset returns the conversion error rather than
  a misleading ordering error

Co-Authored-By: Claude Fable 5 <[email protected]>
Comment thread txnbuild/asset.go
Comment thread txnbuild/liquidity_pool_id.go
@karthikiyer56
karthikiyer56 enabled auto-merge (squash) August 6, 2026 22:27
Comment thread txnbuild/liquidity_pool_deposit.go Outdated
Comment thread xdr/asset.go Outdated
- rewrite the liquidity pool ordering comment in plain English
- extract issuer keys via GetIssuerAccountId instead of a type switch

Co-Authored-By: Claude Fable 5 <[email protected]>
@karthikiyer56
karthikiyer56 force-pushed the fix/asset-ordering-and-pool-leg-selection branch from 47d9ac1 to 3d391ee Compare August 6, 2026 23:19
auto-merge was automatically disabled August 6, 2026 23:27

Pull request was closed

@karthikiyer56 karthikiyer56 reopened this Aug 6, 2026
@karthikiyer56
karthikiyer56 merged commit d2f530f into main Aug 6, 2026
21 checks passed
@karthikiyer56
karthikiyer56 deleted the fix/asset-ordering-and-pool-leg-selection branch August 6, 2026 23:52
karthikiyer56 added a commit to stellar/stellar-horizon that referenced this pull request Aug 7, 2026
Picks up stellar/go-stellar-sdk#5974, which fixes Asset.LessThan to
compare assets by their XDR encoding (raw issuer key) instead of strkey
text, and switches the token_transfer processor to value-based asset
equality so trustline revocation burns the correct liquidity pool leg.
Also carries the required go-xdr bump to
v0.0.0-20260806060815-dc590f17552a.

Co-authored-by: Claude Fable 5 <[email protected]>
Shaptic added a commit that referenced this pull request Aug 14, 2026
Both ship in the tag and were missing from every changelog:

* ingest: ApplyLedgerMetadata closes the datastore and ledger backend and
  propagates the PrepareRange error, so an early return no longer strands a
  goroutine per worker and a failed prepare no longer passes silently.
* go.mod: the go-xdr bump to dc590f1, which fixes decoder bound handling for a
  variable-length field whose length prefix ends the input. 0.6.1 recorded this
  bump under Updates; 0.7.2 carries the same one.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
hypekostas pushed a commit to stellar/stellar-disbursement-platform-backend that referenced this pull request Aug 17, 2026
… updates (#1185)

Yes — the previous response still rendered the Markdown. You want the **literal Markdown source**, with no HTML tags at all.

```markdown
Bumps the minor-and-patch group with 7 updates in the `/` directory:

| Package | From | To |
| --- | --- | --- |
| [github.com/aws/aws-sdk-go-v2](https://github.com/aws/aws-sdk-go-v2) | `1.43.0` | `1.43.5` |
| [github.com/aws/aws-sdk-go-v2/config](https://github.com/aws/aws-sdk-go-v2) | `1.32.31` | `1.32.36` |
| [github.com/aws/aws-sdk-go-v2/service/ses](https://github.com/aws/aws-sdk-go-v2) | `1.37.0` | `1.37.5` |
| [github.com/aws/aws-sdk-go-v2/service/sns](https://github.com/aws/aws-sdk-go-v2) | `1.42.0` | `1.42.5` |
| [github.com/stellar/go-stellar-sdk](https://github.com/stellar/go-stellar-sdk) | `0.6.0` | `0.7.2` |
| [golang.org/x/crypto](https://github.com/golang/crypto) | `0.54.0` | `0.55.0` |
| [golang.org/x/net](https://github.com/golang/net) | `0.57.0` | `0.58.0` |

Updates `github.com/aws/aws-sdk-go-v2` from 1.43.0 to 1.43.5

### Commits

- [`a14f5f1`](aws/aws-sdk-go-v2@a14f5f1) Release 2026-08-10
- [`339f0b6`](aws/aws-sdk-go-v2@339f0b6) Regenerated Clients
- [`0978e3d`](aws/aws-sdk-go-v2@0978e3d) Update API model
- [`3cc614d`](aws/aws-sdk-go-v2@3cc614d) Fix codegen mp ([#3508](https://redirect.github.com/aws/aws-sdk-go-v2/issues/3508))
- [`1434b18`](aws/aws-sdk-go-v2@1434b18) generate response snapshots for json ([#3507](https://redirect.github.com/aws/aws-sdk-go-v2/issues/3507))
- [`ad58f77`](aws/aws-sdk-go-v2@ad58f77) Checkout smithy-go on PRs at the commit pointed out by SMITHY_GO_CODEGEN_VERS...
- [`c002860`](aws/aws-sdk-go-v2@c002860) feat: move close-body, logger, and service-metadata work out of the middlewar...
- [`f152336`](aws/aws-sdk-go-v2@f152336) Release 2026-08-07
- [`37d88d7`](aws/aws-sdk-go-v2@37d88d7) Regenerated Clients
- [`c54b278`](aws/aws-sdk-go-v2@c54b278) Update endpoints model
- Additional commits viewable in [compare view](aws/aws-sdk-go-v2@v1.43.0...v1.43.5)

Updates `github.com/aws/aws-sdk-go-v2/config` from 1.32.31 to 1.32.36

### Commits

- [`a14f5f1`](aws/aws-sdk-go-v2@a14f5f1) Release 2026-08-10
- [`339f0b6`](aws/aws-sdk-go-v2@339f0b6) Regenerated Clients
- [`0978e3d`](aws/aws-sdk-go-v2@0978e3d) Update API model
- [`3cc614d`](aws/aws-sdk-go-v2@3cc614d) Fix codegen mp ([#3508](https://redirect.github.com/aws/aws-sdk-go-v2/issues/3508))
- [`1434b18`](aws/aws-sdk-go-v2@1434b18) generate response snapshots for json ([#3507](https://redirect.github.com/aws/aws-sdk-go-v2/issues/3507))
- [`ad58f77`](aws/aws-sdk-go-v2@ad58f77) Checkout smithy-go on PRs at the commit pointed out by SMITHY_GO_CODEGEN_VERS...
- [`c002860`](aws/aws-sdk-go-v2@c002860) feat: move close-body, logger, and service-metadata work out of the middlewar...
- [`f152336`](aws/aws-sdk-go-v2@f152336) Release 2026-08-07
- [`37d88d7`](aws/aws-sdk-go-v2@37d88d7) Regenerated Clients
- [`c54b278`](aws/aws-sdk-go-v2@c54b278) Update endpoints model
- Additional commits viewable in [compare view](aws/aws-sdk-go-v2@config/v1.32.31...config/v1.32.36)

Updates `github.com/aws/aws-sdk-go-v2/credentials` from 1.19.30 to 1.19.35

### Commits

- [`a14f5f1`](aws/aws-sdk-go-v2@a14f5f1) Release 2026-08-10
- [`339f0b6`](aws/aws-sdk-go-v2@339f0b6) Regenerated Clients
- [`0978e3d`](aws/aws-sdk-go-v2@0978e3d) Update API model
- [`3cc614d`](aws/aws-sdk-go-v2@3cc614d) Fix codegen mp ([#3508](https://redirect.github.com/aws/aws-sdk-go-v2/issues/3508))
- [`1434b18`](aws/aws-sdk-go-v2@1434b18) generate response snapshots for json ([#3507](https://redirect.github.com/aws/aws-sdk-go-v2/issues/3507))
- [`ad58f77`](aws/aws-sdk-go-v2@ad58f77) Checkout smithy-go on PRs at the commit pointed out by SMITHY_GO_CODEGEN_VERS...
- [`c002860`](aws/aws-sdk-go-v2@c002860) feat: move close-body, logger, and service-metadata work out of the middlewar...
- [`f152336`](aws/aws-sdk-go-v2@f152336) Release 2026-08-07
- [`37d88d7`](aws/aws-sdk-go-v2@37d88d7) Regenerated Clients
- [`c54b278`](aws/aws-sdk-go-v2@c54b278) Update endpoints model
- Additional commits viewable in [compare view](aws/aws-sdk-go-v2@credentials/v1.19.30...credentials/v1.19.35)

Updates `github.com/aws/aws-sdk-go-v2/service/ses` from 1.37.0 to 1.37.5

### Commits

- [`b4784c1`](aws/aws-sdk-go-v2@b4784c1) Release 2026-07-01
- [`97c0201`](aws/aws-sdk-go-v2@97c0201) Regenerated Clients
- [`6687238`](aws/aws-sdk-go-v2@6687238) Update endpoints model
- [`995297f`](aws/aws-sdk-go-v2@995297f) Update API model
- [`c26cfc6`](aws/aws-sdk-go-v2@c26cfc6) Fix bump smithy-go to cover multiple issues ([#3461](https://redirect.github.com/aws/aws-sdk-go-v2/issues/3461))
- [`fae66b8`](aws/aws-sdk-go-v2@fae66b8) Set transfer manager error as the first error seen, preventing race condition...
- [`cf0eabd`](aws/aws-sdk-go-v2@cf0eabd) Release 2026-06-30
- [`ad0c091`](aws/aws-sdk-go-v2@ad0c091) Regenerated Clients
- [`196e961`](aws/aws-sdk-go-v2@196e961) Update endpoints model
- [`1529ead`](aws/aws-sdk-go-v2@1529ead) Update API model
- Additional commits viewable in [compare view](aws/aws-sdk-go-v2@v1.37.0...service/pi/v1.37.5)

Updates `github.com/aws/aws-sdk-go-v2/service/sns` from 1.42.0 to 1.42.5

### Commits

- [`dcbed91`](aws/aws-sdk-go-v2@dcbed91) Release 2026-01-09
- [`08120e8`](aws/aws-sdk-go-v2@08120e8) Regenerated Clients
- [`1d7a925`](aws/aws-sdk-go-v2@1d7a925) Update endpoints model
- [`482067d`](aws/aws-sdk-go-v2@482067d) Update API model
- [`4662404`](aws/aws-sdk-go-v2@4662404) remove example ([#3282](https://redirect.github.com/aws/aws-sdk-go-v2/issues/3282))
- [`c28a6f4`](aws/aws-sdk-go-v2@c28a6f4) Release 2026-01-07
- [`2fa7a72`](aws/aws-sdk-go-v2@2fa7a72) Regenerated Clients
- [`077cbaa`](aws/aws-sdk-go-v2@077cbaa) Update endpoints model
- [`3282dbc`](aws/aws-sdk-go-v2@3282dbc) Update API model
- [`3daa74a`](aws/aws-sdk-go-v2@3daa74a) Release 2026-01-06
- Additional commits viewable in [compare view](aws/aws-sdk-go-v2@v1.42.0...service/amp/v1.42.5)

Updates `github.com/stellar/go-stellar-sdk` from 0.6.0 to 0.7.2

### Release Notes

Source: [github.com/stellar/go-stellar-sdk releases](https://github.com/stellar/go-stellar-sdk/releases)

#### v0.7.2

##### What's Changed

- xdr: compare assets by their XDR encoding, and use Equals for asset equality by [@karthikiyer56](https://github.com/karthikiyer56) in [stellar/go-stellar-sdk#5974](https://redirect.github.com/stellar/go-stellar-sdk/pull/5974)
- txnbuild: consolidate liquidity pool ordering guards; xdr and ingest cleanups by [@karthikiyer56](https://github.com/karthikiyer56) in [stellar/go-stellar-sdk#5978](https://redirect.github.com/stellar/go-stellar-sdk/pull/5978)
- strkey: enforce SEP-23 payload lengths in Decode and DecodeAny by [@karthikiyer56](https://github.com/karthikiyer56) in [stellar/go-stellar-sdk#5977](https://redirect.github.com/stellar/go-stellar-sdk/pull/5977)

**Full Changelog:** [v0.7.1...v0.7.2](stellar/go-stellar-sdk@v0.7.1...v0.7.2)

#### v0.7.1

##### What's Changed

- stellartoml: validate domain in GetStellarToml for parity with sibling by [@karthikiyer56](https://github.com/karthikiyer56) in [stellar/go-stellar-sdk#5970](https://redirect.github.com/stellar/go-stellar-sdk/pull/5970)
- ingest: one ledger walk — ExtractLedgerTxParts + EventsFromTxParts/FeesFromTxParts (supersedes the extractor bundles) by [@karthikiyer56](https://github.com/karthikiyer56) in [stellar/go-stellar-sdk#5966](https://redirect.github.com/stellar/go-stellar-sdk/pull/5966)

**Full Changelog:** [v0.7.0...v0.7.1](stellar/go-stellar-sdk@v0.7.0...v0.7.1)

#### v0.7.0

##### What's Changed

- ingest,network,xdr: zero-copy XDR view extractors for full-history ingestion by [@chowbao](https://github.com/chowbao) in [stellar/go-stellar-sdk#5949](https://redirect.github.com/stellar/go-stellar-sdk/pull/5949)
- xdr,xdrgen,ingest: extend xdr views (decoded discriminants, typed opaque, count validation, Fields) and rebuild the view extractors on them by [@tamirms](https://github.com/tamirms) in [stellar/go-stellar-sdk#5951](https://redirect.github.com/stellar/go-stellar-sdk/pull/5951)
- protocols/rpc: add UseUpgradedAuth flag to SimulateTransactionRequest by [@Ryang-21](https://github.com/Ryang-21) in [stellar/go-stellar-sdk#5948](https://redirect.github.com/stellar/go-stellar-sdk/pull/5948)
- protocols/rpc: Add LedgerCloseTime to GetHealthResponse by [@felixl256](https://github.com/felixl256) in [stellar/go-stellar-sdk#5958](https://redirect.github.com/stellar/go-stellar-sdk/pull/5958)
- ingest/loadtest: expand loadtest functionality to handle multiple ledger bundles by [@cjonas9](https://github.com/cjonas9) in [stellar/go-stellar-sdk#5959](https://redirect.github.com/stellar/go-stellar-sdk/pull/5959)
- ingest: expose fee-bump inner hashes on the view extractors by [@tamirms](https://github.com/tamirms) in [stellar/go-stellar-sdk#5964](https://redirect.github.com/stellar/go-stellar-sdk/pull/5964)
- ingest/ledgerbackend: Update captive-core-pubnet.cfg: swap SP with Obsrvr by [@drebelsky](https://github.com/drebelsky) in [stellar/go-stellar-sdk#5963](https://redirect.github.com/stellar/go-stellar-sdk/pull/5963)
- Protocol 28 (CAP-0085) by [@sisuresh](https://github.com/sisuresh) in [stellar/go-stellar-sdk#5965](https://redirect.github.com/stellar/go-stellar-sdk/pull/5965)

##### New Contributors

- [@Ryang-21](https://github.com/Ryang-21) made their first contribution in [stellar/go-stellar-sdk#5948](https://redirect.github.com/stellar/go-stellar-sdk/pull/5948)
- [@felixl256](https://github.com/felixl256) made their first contribution in [stellar/go-stellar-sdk#5958](https://redirect.github.com/stellar/go-stellar-sdk/pull/5958)

**Full Changelog:** [v0.6.0...v0.7.0](stellar/go-stellar-sdk@v0.6.0...v0.7.0)

#### v0.6.1

##### What's Changed

- Backports for Horizon 27.0.1 (release-0.6.1) by [@karthikiyer56](https://github.com/karthikiyer56) in [stellar/go-stellar-sdk#5979](https://redirect.github.com/stellar/go-stellar-sdk/pull/5979)

**Full Changelog:** [v0.6.0...v0.6.1](stellar/go-stellar-sdk@v0.6.0...v0.6.1)

### Changelog

Source: [github.com/stellar/go-stellar-sdk changelog](https://github.com/stellar/go-stellar-sdk/blob/main/CHANGELOG.md)

# Changelog

This repository adheres to [Go module Versioning](https://go.dev/doc/modules/version-numbers).

This monorepo contains a number of SDKs:

- `horizonclient` ([changelog](https://github.com/stellar/go-stellar-sdk/blob/main/clients/horizonclient/CHANGELOG.md))
- `txnbuild` ([changelog](https://github.com/stellar/go-stellar-sdk/blob/main/txnbuild/CHANGELOG.md))
- `rpcclient` ([changelog](https://github.com/stellar/go-stellar-sdk/blob/main/clients/rpcclient/CHANGELOG.md))
- `corelient` ([changelog](https://github.com/stellar/go-stellar-sdk/blob/main/clients/stellarcore/CHANGELOG.md))

Official project releases may be found here: [https://github.com/stellar/go-stellar-sdk/releases](https://github.com/stellar/go-stellar-sdk/releases)

## Pending

### New Features

- protocols/rpc: Add `LatestLedgerCloseTime` and `OldestLedgerCloseTime` to `GetHealthResponse`, exposing the latest and oldest ledgers' close times (unix seconds) on the `getHealth` response ([#5958](https://redirect.github.com/stellar/go-stellar-sdk/pull/5958))

### Breaking Changes

- strkey: `Decode` and `DecodeAny` now validate the payload length against the version byte per [SEP-23](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0023.md). Fixed-length keys (account ID, seed, muxed account, contract, liquidity pool, claimable balance, hashTx, hashX) must decode to their exact canonical size, and signed payloads must carry a declared payload length of 1–64 bytes matched by their zero padding. Inputs with a valid checksum but a wrong-length payload — previously accepted by `Decode`, `DecodeAny`, and every `IsValid*` helper — are now rejected ([#5977](https://redirect.github.com/stellar/go-stellar-sdk/pull/5977)).
  - `NewSignedPayload` rejects empty payloads, matching CAP-40 (the protocol fails such signers with `SET_OPTIONS_BAD_SIGNER`/`txMALFORMED`) and keeping `SignedPayload.Encode` output decodable.
  - Length re-checks that `Decode` now subsumes were removed from `xdr.AccountId.SetAddress`, `xdr.MuxedAccount.SetAddress`, `xdr.SignerKey.SetAddress`, `xdr.ClaimableBalanceId.DecodeFromStrkey`, `strkey.DecodeMuxedAccount`, `strkey.MuxedAccount.SetAccountID`, and txnbuild contract-address parsing. For wrong-length inputs, the xdr and txnbuild callers now return strkey's `invalid payload length` error instead of their own; the strkey muxed-account helpers keep their generic `invalid muxed account` / `invalid ed25519 public key` errors; `xdr.MuxedAccount.SetAddress` is unchanged (it rejects on encoded string length before decoding).
  - `keypair.ParseAddress` wraps every decode failure with `ErrInvalidKey`, so `errors.Is(err, ErrInvalidKey)` keeps matching wrong-length keys (and now also matches checksum/encoding failures, which previously returned the bare strkey error).
  - `DecodeSignedPayload` delegates structure validation to `Decode`; structurally invalid inputs now uniformly error with `invalid signed payload` (previously `signed payload too short: ...` or `invalid signed payload padding`).
- xdr: `Asset.LessThan` now orders assets the way the protocol does — by the raw 32-byte issuer key — instead of by base32 strkey text, and `xdr.NewPoolId` requires strictly `a < b`, rejecting reversed and identical pairs ([#5974](https://redirect.github.com/stellar/go-stellar-sdk/pull/5974))
- txnbuild: liquidity pool operations reject asset pairs that are not strictly ordered; see the [txnbuild changelog](https://github.com/stellar/go-stellar-sdk/blob/main/txnbuild/CHANGELOG.md) ([#5974](https://redirect.github.com/stellar/go-stellar-sdk/pull/5974))

### Bug Fixes

- processors/token_transfer: trustline revocation now compares liquidity pool assets by value instead of pointer identity, fixing wrong-leg selection when burning pool shares ([#5974](https://redirect.github.com/stellar/go-stellar-sdk/pull/5974))

## [0.7.0]

### New Features

- xdr: Protocol 28 support (CAP-0083, CAP-0085). XDR regenerated from [stellar-xdr@9c9c1459](stellar/stellar-xdr@9c9c145), the commit stellar-core 28.0.0 pins; both CAPs are ungated upstream so `XDR_FEATURES` is now empty.

### Commits

- [`b46a463`](stellar/go-stellar-sdk@b46a463) strkey: enforce SEP-23 payload lengths in Decode and DecodeAny ([#5977](https://redirect.github.com/stellar/go-stellar-sdk/issues/5977))
- [`f8cd5df`](stellar/go-stellar-sdk@f8cd5df) txnbuild: consolidate liquidity pool ordering guards; xdr and ingest cleanups...
- [`d2f530f`](stellar/go-stellar-sdk@d2f530f) xdr: compare assets by their XDR encoding, and use Equals for asset equality ...
- [`3114a80`](stellar/go-stellar-sdk@3114a80) ingest: one ledger walk — ExtractLedgerTxParts + EventsFromTxParts/FeesFromTx...
- [`3c3872f`](stellar/go-stellar-sdk@3c3872f) stellartoml: validate domain in GetStellarToml for parity with sibling ([#5970](https://redirect.github.com/stellar/go-stellar-sdk/issues/5970))
- [`2b16db0`](stellar/go-stellar-sdk@2b16db0) Protocol 28 Support ([#5969](https://redirect.github.com/stellar/go-stellar-sdk/issues/5969))
- [`e5d0cb9`](stellar/go-stellar-sdk@e5d0cb9) Merge main into protocol-next ahead of the Protocol 28 GA merge
- [`149b994`](stellar/go-stellar-sdk@149b994) Finalize Protocol 28: pin stellar-xdr @ `9c9c1459` ([#5968](https://redirect.github.com/stellar/go-stellar-sdk/issues/5968))
- [`82df764`](stellar/go-stellar-sdk@82df764) Protocol 28 (CAP-0085) XDR regeneration ([#5965](https://redirect.github.com/stellar/go-stellar-sdk/issues/5965))
- [`8dd9cad`](stellar/go-stellar-sdk@8dd9cad) Update captive-core-pubnet.cfg: swap SP with Obsrvr ([#5963](https://redirect.github.com/stellar/go-stellar-sdk/issues/5963))
- Additional commits viewable in [compare view](stellar/go-stellar-sdk@v0.6.0...v0.7.2)

Updates `golang.org/x/crypto` from 0.54.0 to 0.55.0

### Commits

- [`f44d03d`](golang/crypto@f44d03d) go.mod: update golang.org/x dependencies
- [`5ed4944`](golang/crypto@5ed4944) crypto/internal/poly1305: provide optimised assembly for riscv64
- [`b07833c`](golang/crypto@b07833c) ssh: return window credit for discarded extended data
- [`d701c51`](golang/crypto@d701c51) acme: fix nil pointer dereference in pebble test error reporting
- [`999d053`](golang/crypto@999d053) ssh: fix parsing of GSSAPI payloads offering multiple mechanisms
- [`90f76b8`](golang/crypto@90f76b8) ssh: reject certificate signature keys before recursing
- [`b53964a`](golang/crypto@b53964a) ssh: permit empty but non-nil HostKeyAlgorithms, KeyExchanges, Ciphers, MACs
- [`626e40f`](golang/crypto@626e40f) ssh: drain stderr on forwarded TCP and Unix channels
- [`31914c6`](golang/crypto@31914c6) x509roots/fallback: update bundle
- [`f2135b8`](golang/crypto@f2135b8) all: clean up minor issues found by staticcheck
- Additional commits viewable in [compare view](golang/crypto@v0.54.0...v0.55.0)

Updates `golang.org/x/net` from 0.57.0 to 0.58.0

### Commits

- [`acc78e0`](golang/net@acc78e0) go.mod: update golang.org/x dependencies
- [`90d10f0`](golang/net@90d10f0) internal/http3: delete invalid Content-Length if declared in server handler
- [`08abf4d`](golang/net@08abf4d) internal/http3: infer headers when Content-Encoding is set but is empty
- [`8d10596`](golang/net@8d10596) http2: avoid deadlocks in wrapped ClientConn state callback
- [`99c3b0a`](golang/net@99c3b0a) http2/hpack: build the table lookup maps lazily, only for encoders
- [`5a920b1`](golang/net@5a920b1) http3: rework registration to allow using a fake network
- [`7fd2842`](golang/net@7fd2842) quic: return an error from Accept after PacketConn reader exits
- [`825111d`](golang/net@825111d) quic: avoid busy-loop when keep-alive is blocked by congestion control
- [`a02ddfa`](golang/net@a02ddfa) http/httpproxy: prioritize lowercase proxy environment variables
- [`574e5eb`](golang/net@574e5eb) quic: halt conn goroutines on close when listener exits early
- Additional commits viewable in [compare view](golang/net@v0.57.0...v0.58.0)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

---

You can trigger Dependabot actions by commenting on this PR:

- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore <dependency name> major version` will close this group update PR and stop Dependabot creating any more for the specific dependency's major version (unless you unignore this specific dependency's major version or upgrade to it yourself)
- `@dependabot ignore <dependency name> minor version` will close this group update PR and stop Dependabot creating any more for the specific dependency's minor version (unless you unignore this specific dependency's minor version or upgrade to it yourself)
- `@dependabot ignore <dependency name>` will close this group update PR and stop Dependabot creating any more for the specific dependency (unless you unignore this specific dependency or upgrade to it yourself)
- `@dependabot unignore <dependency name>` will remove all of the ignore conditions of the specified dependency
- `@dependabot unignore <dependency name> <ignore condition>` will remove all of the ignore conditions of the specified dependency
```
Shaptic added a commit that referenced this pull request Aug 17, 2026
* changelog: cut the Pending section as 0.7.2, and record 0.7.1

v0.7.2 was tagged at b46a463 so that stellar-rpc, Horizon and Galexie
v28.0.0 all pin a released SDK tag for Protocol 28; Horizon had been
pinning a pseudo-version to get #5974. Everything the Pending section
listed ships in it, with two corrections:

* the `protocols/rpc` GetHealthResponse close-time fields (#5958) moved to
  [0.7.0] — that commit is an ancestor of the v0.7.0 tag, so it has been
  released since 2026-08-03.
* added a [0.7.1] section for #5966 and #5970, which were tagged on
  2026-08-04 without a changelog entry, so 0.7.2 does not absorb them.

The ingest/ and txnbuild/ sub-changelogs still carry Pending sections whose
contents span several released versions; untangling those is left alone
here.

* ingest: ApplyLedgerMetadata closes the datastore and ledger backend and
  propagates the PrepareRange error, so an early return no longer strands a
  goroutine per worker and a failed prepare no longer passes silently.
* go.mod: the go-xdr bump to dc590f1, which fixes decoder bound handling for a
  variable-length field whose length prefix ends the input. 0.6.1 recorded this
  bump under Updates; 0.7.2 carries the same one.

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
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.

ingest: TestBSBProducerFnCallbackError is flaky, transient/race failures

4 participants