Skip to content

Generate for CAP-0071, update hashing, and record features#524

Merged
sisuresh merged 5 commits intostellar:mainfrom
sisuresh:cap71
Apr 10, 2026
Merged

Generate for CAP-0071, update hashing, and record features#524
sisuresh merged 5 commits intostellar:mainfrom
sisuresh:cap71

Conversation

@sisuresh
Copy link
Copy Markdown
Contributor

@sisuresh sisuresh commented Apr 8, 2026

What

Part of stellar/stellar-core#5154 and https://github.com/stellar/pod-fsr/issues/29

  1. Updates to CAP-0071 XDR.
  2. Updates hashing to strip ifdefs and whitespace to make it simpler for core to do the same and compare XDR.
  3. Adds the xdr features to VERSION so core can make sure the expected features are enabled.

You can see this in use in these draft PRs - stellar-core and rs-soroban-env.

sisuresh added 2 commits April 7, 2026 15:24
Hash XDR files after stripping #ifdef/#endif blocks and removing all
whitespace. This produces a canonical hash of the base XDR content
that is stable regardless of feature ifdefs or formatting differences,
ensuring compatibility between builds with different feature flags.
Lists the XDR feature flags enabled in this build, allowing consumers
to verify that both sides of a bridge have the same features active.
@sisuresh sisuresh marked this pull request as ready for review April 9, 2026 22:50
Copilot AI review requested due to automatic review settings April 9, 2026 22:50
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the generated Stellar XDR Rust/types + JSON schemas to incorporate CAP-0071 additions, makes XDR file hashing stable across formatting/feature-ifdef differences, and exposes enabled XDR feature flags via VERSION for downstream compatibility checks.

Changes:

  • Add CAP-0071 XDR additions (new envelope type + new Soroban credential/delegate types) across generated Rust and JSON schema outputs.
  • Compute stored XDR file SHA256 hashes after stripping #ifdef/#else/#endif blocks and whitespace.
  • Record enabled XDR feature flags in VERSION and add cap_0071 Cargo feature.

Reviewed changes

Copilot reviewed 49 out of 56 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
xdr-version Updates tracked XDR version hash.
xdr-generator-rust/xdr-parser/src/parser.rs Hashing now strips ifdefs/whitespace; parser enum handling adjusted for ifdef-wrapped commas.
Cargo.toml Adds cap_0071 feature flag.
src/lib.rs Extends VERSION with enabled XDR feature list.
src/generated.rs Regenerates file-hash list and wires in new CAP-0071 generated modules/types.
src/generated/envelope_type.rs Adds CAP-0071 conditional ENVELOPE_TYPE_SOROBAN_AUTHORIZATION_WITH_ADDRESS.
src/generated/hash_id_preimage.rs Adds CAP-0071 conditional SorobanAuthorizationWithAddress union arm.
src/generated/hash_id_preimage_soroban_authorization_with_address.rs New nested struct for CAP-0071 hash preimage with address.
src/generated/soroban_credentials_type.rs Adds CAP-0071 conditional credential type enum variant.
src/generated/soroban_credentials.rs Adds CAP-0071 conditional credential union variant.
src/generated/soroban_delegate_signature.rs New CAP-0071 struct for delegate signatures.
src/generated/soroban_address_credentials_with_delegates.rs New CAP-0071 struct for address credentials with delegates.
xdr-json/EnvelopeType.json Updates schema description to include CAP-0071 conditional envelope type.
xdr-json/HashIdPreimage.json Updates schema description to include CAP-0071 conditional union arm.
xdr-json/HashIdPreimageSorobanAuthorizationWithAddress.json New JSON schema for CAP-0071 nested struct.
xdr-json/SorobanCredentialsType.json Updates schema description to include CAP-0071 conditional enum value.
xdr-json/SorobanCredentials.json Updates schema description to include CAP-0071 conditional union arm.
xdr-json/SorobanAuthorizationEntry.json Updates embedded SorobanCredentials schema description for CAP-0071.
xdr-json/SorobanAuthorizationEntries.json Updates embedded SorobanCredentials schema description for CAP-0071.
xdr-json/InvokeHostFunctionOp.json Updates embedded SorobanCredentials schema description for CAP-0071.
xdr-json/Operation.json Updates embedded SorobanCredentials schema description for CAP-0071.
xdr-json/OperationBody.json Updates embedded SorobanCredentials schema description for CAP-0071.
xdr-json/Transaction.json Updates embedded SorobanCredentials schema description for CAP-0071.
xdr-json/TransactionEnvelope.json Updates embedded SorobanCredentials schema description for CAP-0071.
xdr-json/TransactionV0.json Updates embedded SorobanCredentials schema description for CAP-0071.
xdr-json/TransactionV0Envelope.json Updates embedded SorobanCredentials schema description for CAP-0071.
xdr-json/TransactionV1Envelope.json Updates embedded SorobanCredentials schema description for CAP-0071.
xdr-json/TransactionSignaturePayload.json Updates embedded SorobanCredentials schema description for CAP-0071.
xdr-json/TransactionSignaturePayloadTaggedTransaction.json Updates embedded SorobanCredentials schema description for CAP-0071.
xdr-json/TransactionSet.json Updates embedded SorobanCredentials schema description for CAP-0071.
xdr-json/TransactionSetV1.json Updates embedded SorobanCredentials schema description for CAP-0071.
xdr-json/TxSetComponent.json Updates embedded SorobanCredentials schema description for CAP-0071.
xdr-json/TxSetComponentTxsMaybeDiscountedFee.json Updates embedded SorobanCredentials schema description for CAP-0071.
xdr-json/TransactionPhase.json Updates embedded SorobanCredentials schema description for CAP-0071.
xdr-json/TransactionHistoryEntry.json Updates embedded SorobanCredentials schema description for CAP-0071.
xdr-json/TransactionHistoryEntryExt.json Updates embedded SorobanCredentials schema description for CAP-0071.
xdr-json/StoredTransactionSet.json Updates embedded SorobanCredentials schema description for CAP-0071.
xdr-json/StoredDebugTransactionSet.json Updates embedded SorobanCredentials schema description for CAP-0071.
xdr-json/StellarMessage.json Updates embedded SorobanCredentials schema description for CAP-0071.
xdr-json/AuthenticatedMessage.json Updates embedded SorobanCredentials schema description for CAP-0071.
xdr-json/AuthenticatedMessageV0.json Updates embedded SorobanCredentials schema description for CAP-0071.
xdr-json/FeeBumpTransaction.json Updates embedded SorobanCredentials schema description for CAP-0071.
xdr-json/FeeBumpTransactionEnvelope.json Updates embedded SorobanCredentials schema description for CAP-0071.
xdr-json/FeeBumpTransactionInnerTx.json Updates embedded SorobanCredentials schema description for CAP-0071.
xdr-json/GeneralizedTransactionSet.json Updates embedded SorobanCredentials schema description for CAP-0071.
xdr-json/DependentTxCluster.json Updates embedded SorobanCredentials schema description for CAP-0071.
xdr-json/ParallelTxExecutionStage.json Updates embedded SorobanCredentials schema description for CAP-0071.
xdr-json/ParallelTxsComponent.json Updates embedded SorobanCredentials schema description for CAP-0071.
xdr-json/PersistedScpState.json Updates embedded SorobanCredentials schema description for CAP-0071.
xdr-json/PersistedScpStateV0.json Updates embedded SorobanCredentials schema description for CAP-0071.
xdr-json/LedgerCloseMeta.json Updates embedded SorobanCredentials schema description for CAP-0071.
xdr-json/LedgerCloseMetaBatch.json Updates embedded SorobanCredentials schema description for CAP-0071.
xdr-json/LedgerCloseMetaV0.json Updates embedded SorobanCredentials schema description for CAP-0071.
xdr-json/LedgerCloseMetaV1.json Updates embedded SorobanCredentials schema description for CAP-0071.
xdr-json/LedgerCloseMetaV2.json Updates embedded SorobanCredentials schema description for CAP-0071.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@sisuresh
Copy link
Copy Markdown
Contributor Author

sisuresh commented Apr 9, 2026

The JSON schema portion of this is a little weird. It can be addressed in a follow up. Looks like files for new types aren't generated, and parent types have the ifdefs in their descriptions.

@sisuresh sisuresh requested a review from dmkozh April 9, 2026 23:08
@sisuresh sisuresh added this pull request to the merge queue Apr 10, 2026
Merged via the queue into stellar:main with commit f0ed902 Apr 10, 2026
13 checks passed
@sisuresh sisuresh deleted the cap71 branch April 10, 2026 01:42
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.

3 participants