Skip to content

docs: add Soroban storage strategies guide - #2649

Merged
ElliotFriend merged 18 commits into
mainfrom
feat/storage-strategies
Jul 27, 2026
Merged

docs: add Soroban storage strategies guide#2649
ElliotFriend merged 18 commits into
mainfrom
feat/storage-strategies

Conversation

@marcelosalloum

@marcelosalloum marcelosalloum commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

👀 Page available here

What

  • Add Build → How-To Guides → Contract Storage → Storage strategies: eleven production storage patterns, ordered simplest to most complex, distilled from a survey of 874 contract files across 493 public Soroban repositories

Why

  • Storage layout is where Soroban onboarding stalls: existing docs explain the three tiers, but not how production contracts actually combine them at scale

Known limitations

  • There are surely other storage patterns out there, some already on Soroban and others present on different chains that were not implemented on any higher visibility repository yet. Those are meant to be captured incrementally in future versions.

@stellar-jenkins-ci

Copy link
Copy Markdown

@marcelosalloum marcelosalloum self-assigned this Jul 21, 2026
@marcelosalloum
marcelosalloum force-pushed the feat/storage-strategies branch from 8806e46 to e0d7376 Compare July 21, 2026 17:30
@stellar-jenkins-ci

Copy link
Copy Markdown

1 similar comment
@stellar-jenkins-ci

Copy link
Copy Markdown

@stellar-jenkins-ci

Copy link
Copy Markdown

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds a production-oriented Soroban storage strategies guide with interactive diagrams and local Markdown preview support.

Changes:

  • Documents eleven storage patterns, limits, and decision guidance.
  • Adds animated, accessible SVG diagrams.
  • Adds development middleware for Markdown source previews.

Recommendation: NEEDS-CHANGES — address the stored review comments, especially the unsafe allowance example, unsupported protocol claim, middleware defects, and infinite animations.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
docs/build/guides/storage/storage-strategies.mdx Adds the storage guide.
src/components/StorageStrategies/index.ts Exports the diagram component.
src/components/StorageStrategies/diagrams.tsx Defines storage diagrams.
src/components/StorageStrategies/diagrams.css Styles and animates diagrams.
src/components/StorageStrategies/AnimatedDiagram.tsx Adds playback and restoration controls.
src/plugins/markdown-source-dev/index.ts Serves Markdown during development.
docusaurus.config.ts Registers the development plugin.
routes.txt Records the new documentation route.

Comment thread src/plugins/markdown-source-dev/index.ts Outdated
Comment thread src/plugins/markdown-source-dev/index.ts Outdated
Comment thread src/plugins/markdown-source-dev/index.ts Outdated
Comment thread src/components/StorageStrategies/AnimatedDiagram.tsx
Comment thread docs/build/guides/storage/storage-strategies.mdx
Comment thread docs/build/guides/storage/storage-strategies.mdx Outdated
Comment thread docs/build/guides/storage/storage-strategies.mdx
The three looping diagrams auto-started on scroll and never stopped,
breaking the component's plays-once contract (WCAG 2.2.2); capped at
2-3 iterations (~5s) since Replay covers re-watching. The Strategy 4
snippet claimed the deadline was checked but only stored it — now it
shows the write-side validation and read-side expiration guard from
the canonical token example.
Serving raw markdown under docusaurus start meant re-deriving source
paths from URLs, which missed README-backed section pages, /docs.md,
and front-matter slugs, and required a fragile re-install of the eval
source map middleware that silently failed on Docusaurus 3.10. Not
worth the surface: the Open Markdown button works in production and
PR previews, where docusaurus-markdown-source-plugin resolves sources
from route metadata.
@stellar-jenkins-ci

Copy link
Copy Markdown

@marcelosalloum
marcelosalloum force-pushed the feat/storage-strategies branch from e82a82f to 6d0e48d Compare July 21, 2026 21:37
@stellar-jenkins-ci

Copy link
Copy Markdown

@marcelosalloum
marcelosalloum marked this pull request as ready for review July 21, 2026 21:56
@ElliotFriend
ElliotFriend requested a review from Copilot July 22, 2026 13:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 7 comments.

Comment thread src/components/StorageStrategies/diagrams.tsx Outdated
Comment thread docs/build/guides/storage/storage-strategies.mdx
Comment thread docs/build/guides/storage/storage-strategies.mdx Outdated
Comment thread docs/build/guides/storage/storage-strategies.mdx Outdated
Comment thread docs/build/guides/storage/storage-strategies.mdx Outdated
Comment thread docs/build/guides/storage/storage-strategies.mdx Outdated
Comment thread docs/build/guides/storage/storage-strategies.mdx Outdated

@ElliotFriend ElliotFriend left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

overall, this is great!!

i left a few thoughts and nitpicks throughout, as well. the big one that i'd love confirmation on is the max ledger entry size. the lab says the limit for all entries is 128 KiB, not only the Wasm entries. it's listed as 64 KiB in this guide several times.

Comment thread docs/build/guides/storage/storage-strategies.mdx Outdated
Comment thread docs/build/guides/storage/storage-strategies.mdx Outdated
Comment thread docs/build/guides/storage/storage-strategies.mdx
Comment thread docs/build/guides/storage/storage-strategies.mdx
Comment thread docs/build/guides/storage/storage-strategies.mdx Outdated
Comment thread docs/build/guides/storage/storage-strategies.mdx
Comment thread docs/build/guides/storage/storage-strategies.mdx Outdated
Comment thread docs/build/guides/storage/storage-strategies.mdx Outdated
Comment thread docs/build/guides/storage/storage-strategies.mdx Outdated
Comment thread docs/build/guides/storage/storage-strategies.mdx Outdated
@marcelosalloum

Copy link
Copy Markdown
Contributor Author

The value on https://lab.stellar.org/network-limits is incorrect, there are actually 2 distinct limits:

  • 64KiB for contract entries
  • 128KiB for the contract wasm entry

That can be verified through the CLI with stellar network settings --network mainnet, and I opened a PR with the fix on stellar/laboratory#2163. The PR has more context if you're interested. I had AI testing those limits and it confirmed the distinct limits between regular data entries and the wasm size.

As for the remaining comments, I'll address them shortly.

@stellar-jenkins-ci

Copy link
Copy Markdown

@stellar-jenkins-ci

Copy link
Copy Markdown

@ElliotFriend ElliotFriend left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nice work!! thanks SO MUCH for putting this together! 🎉

@ElliotFriend
ElliotFriend merged commit abf2528 into main Jul 27, 2026
10 checks passed
@ElliotFriend
ElliotFriend deleted the feat/storage-strategies branch July 27, 2026 18:02
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