Skip to content

Regenerate with SCSpecTypeUDTV2 - #564

Closed
leighmcculloch wants to merge 2 commits into
const-xdr-serializationfrom
scspec-udt-v2-id-field-9jgp9b
Closed

Regenerate with SCSpecTypeUDTV2#564
leighmcculloch wants to merge 2 commits into
const-xdr-serializationfrom
scspec-udt-v2-id-field-9jgp9b

Conversation

@leighmcculloch

@leighmcculloch leighmcculloch commented Jul 29, 2026

Copy link
Copy Markdown
Member

Warning

Stacked on #562, so the diff here is only the regeneration. Depends on unmerged changes in stellar/stellar-xdr. A valid merge order for the whole stack:

  1. Add SCSpecTypeUDTV2 with a type id stellar-xdr#310 — add SCSpecTypeUDTV2 to the contract spec XDR
  2. Add borrowed Ref variants of generated types #560 — borrowed Ref variants of the generated types
  3. Add const XDR serialization on View types #562 — const XDR serialization on those Ref types
  4. this PR
  5. Bump stellar-xdr for SCSpecTypeUDTV2 rs-soroban-env#1714 — re-pin to this regeneration
  6. Encode contract spec XDR at const evaluation time rs-soroban-sdk#1965 — encode contract spec XDR at const evaluation time
  7. Reference user-defined types by id rs-soroban-sdk#1966 — reference user-defined types by id

What

Advance the xdr submodule to the contract spec definition that adds SCSpecTypeUDTV2 and regenerate, which brings in the ScSpecTypeUdtv2 type, the ScSpecTypeDef::UdtV2 variant that holds it, and the const-serialization form of both.

ScSpecTypeUdtv2 holds a single fixed-size [u8; 8], so it has nothing to borrow and the generator emits no ScSpecTypeUdtv2Ref for it. ScSpecTypeDefRef::UdtV2 therefore holds the owned struct directly, the same way ScSpecTypeDefRef::BytesN holds ScSpecTypeBytesN.

Why

ScSpecTypeUdtv2 is the reference form that identifies the user-defined type being referenced by an 8-byte id, rather than naming it and nothing more. Downstream needs the generated type before it can build spec entries that use it, and it needs the const form in particular because the Rust SDK assembles contract specs at const evaluation time.

Known limitations

The submodule points at an unmerged stellar-xdr branch, so this cannot merge until that lands and the pointer is moved to the merged commit.

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.

1 participant