Skip to content

Conversation

Shaptic
Copy link
Contributor

@Shaptic Shaptic commented May 19, 2025

This corresponds to stellar/stellar-xdr@4b7a2ef.

This is a great example of the step-by-step process to update XDR with each commit message describing the detailed separate steps of the process.

@Shaptic Shaptic requested a review from a team May 19, 2025 22:02
@Shaptic Shaptic changed the base branch from master to protocol-23 May 19, 2025 22:02
Copy link

github-actions bot commented May 19, 2025

Size Change: +8.76 kB (+0.26%)

Total Size: 3.32 MB

Filename Size Change
dist/stellar-base.js 2.44 MB +6.88 kB (+0.28%)
dist/stellar-base.min.js 882 kB +1.88 kB (+0.21%)

compressed-size-action

Change the commit hash to the right sha of stellar/stellar-xdr.
Add any new filenames (if needed: here Stellar-exporter.x for Galexie).
Run `make reset-xdr` from the project root.
@Shaptic Shaptic force-pushed the bump-xdr branch 2 times, most recently from 53feed7 to 0d719c4 Compare May 19, 2025 22:13
Shaptic added 2 commits May 19, 2025 15:17
* Move `xdr.Operation` into a hidden namespace to avoid conflicts with the
  SDK's `Operation`.
* Minimize the diff by running `sed -ie s/\"/\'/g types/{curr,next}.d.ts`
  (because the generator uses a different prettier config--this could
  probably be fixed in the generator itself, but this is easy enough
  for now).
* Add workarounds:
  - `type Hash = Opaque[];` is a necessary alias that doesn't get gen'd
  - `Hyper`, `UnsignedHyper`, and `ScSpecEventV0` need their signatures
    fixed because it should take a proper `Array` instead of a naked `[]`
    (enforced by `yarn lint`).
  - Some constants aren't generated correctly, ref. the linked issue

Account for generator bugs: constants that aren't present
* This accounts for any fields that encountered a rename as part
  of the new XDR version. In this case, `readBytes` was renamed to
  `diskReadBytes` because it's measured differently as a result of
  Core's state living in memory rather than on disk in most cases.
* It also accounts for the unused extension point actually having
  a name now, so `xdr.ExtensionPoint` needs to use the structure-
  specific `xdr.SorobanTransactionDataExt`, instead.
@sreuland
Copy link
Contributor

the separate commits for each step are great. Do you think it's worth including link to this pr as example of those steps in the existing README#xdr-update, it doesn't mention this type of guidance.

Copy link
Contributor

@sreuland sreuland left a comment

Choose a reason for hiding this comment

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

lgtm, my approval is probably half strengh, I'm not active in js layer as much.

@Shaptic
Copy link
Contributor Author

Shaptic commented May 19, 2025

Yep good call @sreuland, I jotted that down as a TODO but might as well throw it in. I think your ✔️ is good enough - there's no major code changes here and CI passes.

@Shaptic Shaptic merged commit c26916f into protocol-23 May 19, 2025
7 checks passed
@Shaptic Shaptic deleted the bump-xdr branch May 19, 2025 23:55
Shaptic added a commit that referenced this pull request Jun 18, 2025
* 1. Run the generator:

Change the commit hash to the right sha of stellar/stellar-xdr.
Add any new filenames (if needed: here Stellar-exporter.x for Galexie).
Run `make reset-xdr` from the project root.

* 2. Post-generation fixups to work around bugs or project-specific stuff:

* Move `xdr.Operation` into a hidden namespace to avoid conflicts with the
  SDK's `Operation`.
* Minimize the diff by running `sed -ie s/\"/\'/g types/{curr,next}.d.ts`
  (because the generator uses a different prettier config--this could
  probably be fixed in the generator itself, but this is easy enough
  for now).
* Add workarounds:
  - `type Hash = Opaque[];` is a necessary alias that doesn't get gen'd
  - `Hyper`, `UnsignedHyper`, and `ScSpecEventV0` need their signatures
    fixed because it should take a proper `Array` instead of a naked `[]`
    (enforced by `yarn lint`).
  - Some constants aren't generated correctly, ref. the linked issue

* 3. Accommodate XDR additions or renames:

* This accounts for any fields that encountered a rename as part
  of the new XDR version. In this case, `readBytes` was renamed to
  `diskReadBytes` because it's measured differently as a result of
  Core's state living in memory rather than on disk in most cases.
* It also accounts for the unused extension point actually having
  a name now, so `xdr.ExtensionPoint` needs to use the structure-
  specific `xdr.SorobanTransactionDataExt`, instead.

* Add docs to README for completeness
Shaptic added a commit that referenced this pull request Jun 25, 2025
* Add strkey support for liquidity pools and claimable balances (#799)
* Regenerate XDR with latest Protocol 23 version (#800)
* Migrate cryptographic libraries to use modern @noble/curves. (#802)
* Add support for encoding `Address` to/from new `StrKey`s (#801)
* Allow specifying mixed types for vectors in `nativeToScVal` (#803)
* Prepare v14.0.0-rc.1, Protocol 23 for release (#804)
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.

2 participants