Adopt spec entry ids and id-based reference resolution - #2677
Closed
leighmcculloch wants to merge 5 commits into
Closed
Adopt spec entry ids and id-based reference resolution#2677leighmcculloch wants to merge 5 commits into
leighmcculloch wants to merge 5 commits into
Conversation
This was referenced Aug 10, 2026
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.
Note
Part of a stack of PRs that must merge in this order.
A first group of PRs deliver const-encoded contract specs, so that contract specs are produced at compile time instead of at proc-macro execution time. This provides the foundation for the capability to construct the specs from information that is not known at proc-macro execution and only known at compile time, like the fully qualified name of a type:
A second group of PRs deliver ids on contract spec entries and in spec references. Every entry carries an 8-byte id hashed from the fully qualified name of the item it describes, and a reference to a user-defined type carries the id of the entry it refers to, so references stay unambiguous even when items share a name. This resolves the type identity problem (stellar/rs-soroban-sdk#1570) and type alias limitations (stellar/rs-soroban-sdk#1857):
What
Patch
stellar-xdrto stellar/rs-stellar-xdr#568 and the soroban spec crates to stellar/rs-soroban-sdk#1998, moving the workspace to stellar-xdr 28 and soroban-env-host 28.0.1, and adapt the CLI to specs whose entries carry ids:soroban-spec-tools'Specnormalizes v2 entries on construction — each entry's v0 body is stored so all consumers keep matching one shape — and keeps each entry's id keyed to its body. AScSpecTypeUdtv2reference resolves throughfind_udt_v2: the entry whose id matches when one does, exactly even when entries share a name, falling back to the referenced name for specs of v0 entries.ScVal::ExecutableTagandContractExecutable::ExternalRefvariants.Why
Contract spec entries now carry an id hashed from the fully qualified name of the item they describe, and references to user-defined types carry the id of the entry they refer to. The CLI has to read, print, and generate bindings from specs produced by SDKs that emit them — and with ids it can resolve a reference to exactly the entry it was written against.
Known limitations
Merging depends on the upstream PRs landing and releasing, with the
[patch.crates-io]git revisions replaced by published versions. Network-backed test suites need a quickstart image running a protocol 28 host.