Fixing a few issues with the soroban-sdk's production of specs (type ids, name collisions, aliasing, ...) #2014
leighmcculloch
started this conversation in
General Discussion
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Hi all,
We're making a change to soroban-sdk that is largely an implementation detail, but I wanted to give some visibility to as it will eliminate a few problems that have existed since inception.
The change will make every type in contract specs uniquely identifiable. Spec entry names outputted by the soroban-sdk macros will change from being simple names like
MyTypeto fully qualified paths::mycrate::apath::MyTypeand then the stellar-cli will reduce them back to unique short identifiers.Why:
Why now:
Ecosystem Impact:
These are the changes:
1️⃣ Change when contract specs are produced to later in the compilation process instead of at proc-macro expansion time. This provides the foundation for constructing the specs from information that is only known later in the compilation process, like the fully qualified name of a type:
2️⃣ Add fully qualified type names in contract specs and pre-process them:
3️⃣ Leverage the unique names to optimise the data that needs to be stored in contracts for spec shaking:
All reactions