stellar / quickstart

Home of the stellar/quickstart docker image for development and testing
Apache License 2.0
186 stars 206 forks source link

`--limits unlimited` is limiting at least the `contractDataKeySizeBytes` limit #577

Closed kalepail closed 5 months ago

kalepail commented 6 months ago

What version are you using?

docker run --rm -i \
    -p "8000:8000" \
    --name stellar \
    stellar/quickstart:latest \
    --local \
    --limits unlimited \
    --enable-soroban-rpc \
    --enable-soroban-diagnostic-events

As of the time of this ticket open.

What did you do?

// the limit is 300 but a key includes more than _just_ the data. 248 works, 249 fails.
env.storage().persistent().set(&Bytes::from_array(&env, &[0u8; 249]), &true);

What did you expect to see?

When invoking the function which calls the above on the unlimited local network I would expect the function to pass.

What did you see instead?

I get an error during submission

{
  errorResultXdr: "AAAAAP/////////vAAAAAA==",
  status: "ERROR",
  hash: "a063178e27b6e812d6c2bf9e8cd41723373bf7448c189d274a4aa0aad5e9f10c",
  latestLedger: 1446,
  latestLedgerCloseTime: "1709310433",
}

Other tx limits besides CPU and memory can be exceeded, such as the number of reads and writes as well as the number of bytes which can be read or written. At least this contractDataKeySizeBytes however seems to not be able to be exceeded.

This is important to resolve in order to allow folks to test extreme cases past live network phased limits in order for devs to get a full picture of all their contract invocation costs. Especially given the AAAAAP/////////vAAAAAA== gives zero clues as to the nature of the exceeded limit.

kalepail commented 6 months ago

Looking at https://stellar.expert/explorer/public/protocol-history for Soroban runtime configs we need to “unlimitize” all these values at the very least.

{
    "contractDataEntrySizeBytes": 65536,
    "contractCompute": {
        "txMaxInstructions": "100000000",
        "txMemoryLimit": 41943040
    },
    "contractMaxSizeBytes": 65536,
    "contractLedgerCost": {
        "txMaxReadLedgerEntries": 40,
        "txMaxReadBytes": 133120,
        "txMaxWriteLedgerEntries": 25,
        "txMaxWriteBytes": 66560
    },
    "contractEvents": {
        "txMaxContractEventsSizeBytes": 8198
    },
    "contractDataKeySizeBytes": 200,
    "contractBandwidth": {
        "txMaxSizeBytes": 71680
    }
}
github-actions[bot] commented 5 months ago

This issue is stale because it has been open for 30 days with no activity. It will be closed in 30 days unless the stale label is removed.

kalepail commented 5 months ago

Solved via https://github.com/stellar/quickstart/pull/579