Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

soroban-rpc: enforce network limits during preflight #38

Closed
8 tasks
MonsieurNicolas opened this issue Feb 8, 2023 · 3 comments
Closed
8 tasks

soroban-rpc: enforce network limits during preflight #38

MonsieurNicolas opened this issue Feb 8, 2023 · 3 comments

Comments

@MonsieurNicolas
Copy link

Not all limits are implemented right now.

This issue tracks both adding the missing ones enforced at validation/apply time, and enforcing them during preflight.

  • int64 txMaxSizeBytes; // maximum size an xdr encoded transaction can be (also enforced by the tx endpoint)
  • int64 txMaxGas; // maximum gas per transaction
  • uint32 txMaxReadLedgerEntries; // maximum number of ledger entry read operations per transaction (footprint)
  • int64 txMaxReadBytes; // maximum number of bytes that can be read per transaction
  • uint32 txMaxWriteLedgerEntries; // maximum number of ledger entry write operations per transaction (footprint)
  • int64 txMaxWriteBytes; // maximum number of bytes that can be written per transaction
  • uint32 txMaxExtendedDataSizeBytes; // maximum size of extended data produced by a transaction (this
  • int64 txMaxResultSizeBytes; // maximum size of a transaction result (gets folded into txMaxExtendedDataSizeBytes if we replace this by the hash in history archives)

I grabbed most of this list from https://github.com/stellar/stellar-protocol/blob/master/core/cap-0046-07.md but there could be more.

@MonsieurNicolas
Copy link
Author

@sisuresh FYI

@jayz22
Copy link
Contributor

jayz22 commented Apr 26, 2023

Updated fee-related network limits:

    // Maximum instructions per transaction
    int64 txMaxInstructions;

    // Memory limit per transaction.
    uint32 txMemoryLimit;

    // Maximum number of ledger entry read operations per transaction
    uint32 txMaxReadLedgerEntries;

    // Maximum number of bytes that can be read per transaction
    uint32 txMaxReadBytes;

    // Maximum number of ledger entry write operations per transaction
    uint32 txMaxWriteLedgerEntries;

    // Maximum number of bytes that can be written per transaction
    uint32 txMaxWriteBytes;

    // Maximum size of extended meta data (mostly from events) produced by a transaction
    uint32 txMaxExtendedMetaDataSizeBytes;

(see the google sheet for their relation to the fee calculation)

Other limits that may also need to be validated:

    // Maximum size in bytes for a transaction
    uint32 txMaxSizeBytes;

    // Maximum allowed size of contract code in bytes (relevant for install install contract and update contract code)
    uint32 contractMaxSizeBytes;

    // Maximum contract data key and entry size 
    uint32 contractDataKeySizeBytes{};
    uint32 contractDataEntrySizeBytes{};

These value are all specified ConfigSettingEntry from the network and preflight needs the additional logic to compare the simulateTransaction output against these limits (and provide the info to the user).

(Discussed offline with @tsachiherman and @dmkozh )

@sisuresh sisuresh transferred this issue from stellar/rs-soroban-env Jun 7, 2023
@sisuresh sisuresh changed the title Preflight: enforce network limits soroban-rpc: enforce network limits during preflight Jun 7, 2023
@sisuresh
Copy link
Contributor

sisuresh commented Jun 7, 2023

The limits have already been enforced in core, so I transferred the issue over here for the pending rpc work.

@stellarsaur stellarsaur transferred this issue from stellar/stellar-cli Feb 1, 2024
@2opremio 2opremio closed this as completed May 7, 2024
@github-project-automation github-project-automation bot moved this from Backlog to Done in Platform Scrum May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

No branches or pull requests

4 participants