Correct Soroban transaction resource, TTL, and SAC XDR references - #2655
Open
ElliotFriend wants to merge 2 commits into
Open
Correct Soroban transaction resource, TTL, and SAC XDR references#2655ElliotFriend wants to merge 2 commits into
ElliotFriend wants to merge 2 commits into
Conversation
Fixes three Raven-reported drifts in Soroban transaction/XDR reference docs, verified against current stellar-xdr (curr) and stellar-core behavior. #2596 — transaction resource field names: - SorobanResources uses diskReadBytes (not readBytes); SorobanTransactionData uses resourceFee with the ext union first (not refundableFee + ExtensionPoint) - fixes the runtime-broken JS restoration example (readBytes / ExtensionPoint) - sweeps prose in state-archival and fees-resource-limits-metering #2597 — ExtendFootprintTTLOp extends every read-only footprint entry; the real constraint is one shared extendTo, not one key per transaction. #2613 — current XDR enums: CONTRACT_EXECUTABLE_STELLAR_ASSET, CONTRACT_ID_PREIMAGE_FROM_ASSET, ENVELOPE_TYPE_CONTRACT_ID; issuer is only the initial (mutable) SAC administrator. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Updates Soroban resource, TTL, and SAC documentation to current XDR terminology and behavior.
Changes:
- Renames obsolete resource and SAC XDR fields.
- Corrects multi-entry TTL-extension guidance.
- Clarifies mutable SAC administration.
Blocking findings include a still-unusable restoration example, contradictory TTL example, stale XDR link, and incomplete resolution of issues #2596 and #2613.
Recommendation: NEEDS-CHANGES — Address the stored review comments.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
docs/tokens/stellar-asset-contract.mdx |
Updates SAC XDR and administrator terminology. |
docs/learn/fundamentals/fees-resource-limits-metering.mdx |
Renames the declared resource-fee field. |
docs/learn/fundamentals/contract-development/storage/state-archival.mdx |
Renames the disk-read resource field. |
docs/learn/fundamentals/contract-development/contract-interactions/stellar-transaction.mdx |
Updates current transaction and SAC XDR layouts. |
docs/build/guides/archival/extend-persistent-entry-js.mdx |
Revises multi-entry TTL guidance. |
docs/build/guides/archival/create-restoration-footprint-js.mdx |
Updates JavaScript XDR construction. |
|
Preview is available here: |
- extend-persistent-entry: replace the two-transaction split with a real single-operation combined-footprint example (setReadOnly([entry, footprint])) so it matches the corrected multi-key/same-target guidance (#2597) - create-restoration-footprint: add a caution that the zeroed diskReadBytes/ writeBytes/resourceFee are placeholders and a real restore must populate them via simulation or it fails with RESTORE_FOOTPRINT_RESOURCE_LIMIT_EXCEEDED - stellar-asset-contract: repoint the stale pinned [contract_id] link to the current XDR (curr); add SAC on-chain identification guidance (SCContractInstance.executable == CONTRACT_EXECUTABLE_STELLAR_ASSET, name()/symbol() after verification, provenance limits) - fees-resource-limits-metering: distinguish the pre-apply declared-resourceFee check from apply-time refundable metering - state-archival: soften diskReadBytes wording to "serialized size" Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Preview is available here: |
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.
Batch fix for three Raven-reported drifts in the Soroban transaction/XDR reference docs. All claims verified against current
stellar-xdr(curr) and stellar-core behavior before editing.Changes
Transaction resource field names (#2596)
Protocol 23+ renamed the resource fields, but the reference docs still used the old names — and one example was runtime-broken as a result.
stellar-transaction.mdx—SorobanResourcesnow usesdiskReadBytes(wasreadBytes);SorobanTransactionDatanow shows the current layout: theextunion first, thenresources, thenresourceFee(wasrefundableFee+ a trailingExtensionPoint). Added the referencedSorobanResourcesExtV0so the block is self-contained. Prose updated to match.create-restoration-footprint-js.mdx— the JS example constructedxdr.SorobanResources({... readBytes ...})andext: new xdr.ExtensionPoint(0), which throws at serialization against currentjs-stellar-base. Now usesdiskReadBytesandxdr.SorobanTransactionDataExt(0). Walkthrough bullet updated.state-archival.mdx,fees-resource-limits-metering.mdx— swept the same stalereadBytes/refundableFeeprose references.(The issue's "enforcement phases" half cites no concrete wrong sentence, so that speculative rewrite is intentionally out of scope.)
Multi-entry
ExtendFootprintTTLOpguidance (#2597)extend-persistent-entry-js.mdxclaimed you "cannot combine extensions for different ledger entries in a single transaction." CurrentExtendFootprintTTLOpFrameiterates every entry in the read-only footprint. The real constraint is the single sharedextendTooffset — entries needing different targets are what require separate operations/transactions. Reworded to match; the existing two-transaction example is now framed as the different-target case.SAC executable identity XDR terminology (#2613)
Design-era XDR names in
stellar-transaction.mdxandstellar-asset-contract.mdxno longer matchstellar-xdr:CONTRACT_EXECUTABLE_TOKEN→CONTRACT_EXECUTABLE_STELLAR_ASSETCONTRACT_ID_FROM_ASSET→CONTRACT_ID_PREIMAGE_FROM_ASSETHashIDPreimage::ENVELOPE_TYPE_CONTRACT_ID_FROM_ASSET→HashIDPreimage::ENVELOPE_TYPE_CONTRACT_ID(theFROM_ASSETpreimage now nests under it)Also qualified the issuer/admin relationship: the asset issuer is only the initial administrator, and authority is mutable via
set_admin.Closes #2596
Closes #2597
Closes #2613
🤖 Generated with Claude Code