Skip to content

Choosing the right storage: unverified claims about the entry size limit and storage cost ordering #2879

Closed

Description

@ElliotFriend

Follow-up to #1841, which closed when #2835 merged. #2835 fixed the code snippets on Choosing the right storage, but two prose claims on the page were left unverified, and one of them is not guaranteed by the protocol.

1. "The network limit can never go down" is not enforced

docs/build/guides/storage/choosing-the-right-storage.mdx line 93:

Keep in mind, that the network limit can never go down, so the instance can't ever become non-valid.

stellar-core only checks a proposed CONFIG_SETTING_CONTRACT_DATA_ENTRY_SIZE_BYTES upgrade against a fixed floor, not against the current value (src/ledger/NetworkConfig.cpp):

case ConfigSettingID::CONFIG_SETTING_CONTRACT_DATA_ENTRY_SIZE_BYTES:
    valid = cfg.contractDataEntrySizeBytes() >=
            MinimumSorobanNetworkConfig::MAX_CONTRACT_DATA_ENTRY_SIZE_BYTES;

MAX_CONTRACT_DATA_ENTRY_SIZE_BYTES is 2,000 bytes (src/ledger/NetworkConfig.h). A validator vote could lower the entry size limit to any value at or above that, so the protocol does not promise that a large instance stays within the limit. Validators may never do this in practice, but the sentence states it as a guarantee.

Suggested fix: reword to say the limit is set by validator vote and is not expected to decrease, or drop the guarantee and advise keeping instance storage well under the current limit.

2. The "Cost" column ordering needs a check

Storage type Cost
Persistent Most expensive
Temporary Less expensive
Instance More expensive

Temporary being cheapest holds, since temporary entries use a lower rent rate. The persistent vs. instance ordering is less clear: instance data lives in the contract instance entry, which has persistent durability and pays persistent rent, but it is loaded (and billed as a read) on every invocation. Whether "Most" belongs on persistent or instance depends on the access pattern, so the column may be better replaced with a short explanation than a ranking.

Scope

Prose only. The code snippets were fixed and compiled against soroban-sdk 28 in #2835.

Activity

  1. added
    bug
    documentation
    on Sep 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugdocumentation

    Type

    No type

    Projects

    • Status
      No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions