Remove limits on sub-items from spec definitions#285
Merged
leighmcculloch merged 2 commits intocurrfrom Oct 9, 2025
Merged
Conversation
dmkozh
approved these changes
Oct 9, 2025
sisuresh
pushed a commit
to sisuresh/stellar-xdr-next
that referenced
this pull request
Nov 26, 2025
sisuresh
added a commit
that referenced
this pull request
Nov 26, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Remove fixed element limits from UDT struct fields, union cases, enum cases error enum cases, function inputs, and event params, essentially changing the max from the specified maxes to u32::MAX.
Why
Early on during Soroban's development we set limits on a lot of the new types to make decoding safer. However we quickly discovered that type of limiting was insufficient and we removed the limits and for XDR limits we now instead use some other strategies by measuring bytes and depth. However when we removed the limits from the new contract types we didn't remove the limits from the spec types and they remained. A couple times the limits have caused problems and with the limits being largely arbitrary they should be removed.
Related conversation: https://stellarfoundation.slack.com/archives/C08NEGD4PPG/p1758877637503109
Merging
This is a non-breaking change with regards to the XDR binary, but it is a breaking change with regards to the Rust library that is generated from the XDR. It's a breaking change because the max limits are encoded into the types via generic parameters. So the safest time to make this change is during the next major version, v24.