Skip to content

Commit deac013

Browse files
authored
Update resources and limits for p23. (#1730)
Also cleaned up the section a bit to have a more clear difference between transaction and ledger limits.
1 parent 77e022c commit deac013

1 file changed

Lines changed: 49 additions & 31 deletions

File tree

docs/networks/resource-limits-fees.mdx

Lines changed: 49 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -11,39 +11,57 @@ Resource limitations and fees only apply to smart contract transactions. Read mo
1111

1212
:::
1313

14-
| Network Setting | Value |
15-
| --- | --- |
16-
| Soroban txn per ledger | 100 |
17-
| Max CPU instructions per txn | 100 million |
18-
| Memory limit per txn | 40 MB |
19-
| Individual ledger key size (contract storage key) | 250 bytes |
20-
| Individual ledger entry size (including Wasm entries) | 128 KiB |
21-
| Read/Write ledger entries per txn | 40 read; 25 write |
22-
| Read/Write bytes per txn | 200 KB read; 129 KiB write |
23-
| Transaction size | 129 KiB |
24-
| Persistent entry minimal/initial lifetime | 120 days |
25-
| Temporary entry minimal/initial lifetime | 1 day |
26-
| Max ledger entry expiration bump | 6 months |
27-
| Events+return value size bytes | 8 KB |
28-
| Max write bytes per ledger | 140 KiB |
29-
| Max txs size in bytes per ledger | 130 KiB |
30-
| Eviction scan size | 500 KB |
14+
### Per-transaction limits
15+
16+
These define the maximum amount of work a single Smart contract transaction can do.
17+
18+
| Network Setting | Value |
19+
| ----------------------------------------------------- | ------------------ |
20+
| Max CPU instructions | 100 million |
21+
| Max memory (RAM) | 40 MB |
22+
| Max number of keys in the footprint | 100 |
23+
| Disk reads\* | 100 entries/200 KB |
24+
| Disk writes | 50 entries/132 KB |
25+
| Transaction size | 132 KB |
26+
| Events+return value size bytes | 16 KB |
27+
| Individual ledger key size (contract storage key) | 250 bytes |
28+
| Individual ledger entry size (including Wasm entries) | 128 KiB |
29+
30+
\* Most transactions don't perform any disk reads, as only archived entries and 'classic' entries (G-accounts, trustlines) are considered to be disk reads. Live smart contract state is in-memory and is not counted towards this limit.
31+
32+
### TTL extension parameters
33+
34+
These define TTL extension parameters.
35+
36+
| Persistent entry TTL on creation | 120 days | | Temporary entry TTL on creation | 1 day | | Max ledger entry TTL extension | 6 months |
37+
38+
### Ledger-wide limits
39+
40+
These define the maximum amount of work done by all the transactions in a single ledger (single block).
41+
42+
| Network Setting | Value |
43+
| ----------------------------------- | ------------------ |
44+
| Max CPU instructions | 600 million |
45+
| Max memory (RAM) | no explicit limit |
46+
| Max number of keys in the footprint | no explicit limit |
47+
| Disk reads | 1000 entries/7 MB |
48+
| Disk writes | 500 entries/143 KB |
49+
| Transactions size | 133 KB |
50+
| Events+return value size bytes | no explicit limit |
3151

3252
## Resource Fees
3353

3454
| Network Setting | Cost (stroops) |
3555
| :--------------------------------------------- | :------------------------ |
36-
| 10,000 instructions | 25 (250,000/max tx) |
37-
| Read 1 ledger entry | 6,250 (250,000/max tx) |
38-
| Write 1 ledger entry | 10,000 (250,000/max tx) |
39-
| Read 1KB from ledger | 1,786 (250,000/max tx) |
40-
| 1KB of transaction size (bandwidth) | 1,624 (113,642/max tx) |
41-
| 1KB of transaction size (history) | 16,235 (1,136,418/max tx) |
42-
| 1KB of Events/return value | 10,000 (80,000/max tx) |
43-
| Write 1KB to ledger | ~11,800 (826'000/max tx) |
44-
| 30 days of rent for 1 KB of persistent storage | 0.29 XLM |
45-
| 30 days of rent for 1 KB of temporary storage | 0.145 XLM |
46-
47-
Note that the write fee normally fluctuates a bit (within 100 stroops/KB). However, if the ledger grows too quickly, the write fee will grow in a linear fashion with a steep slope.
48-
49-
The ledger rent cost ('Write 1KB' entries in the table) is based on the write fee, rent period and some coefficient.
56+
| 10,000 CPU instructions | 25 (250,000/max tx) |
57+
| Read 1 ledger entry from disk | 6,250 (625,000/max tx) |
58+
| Read 1KB from disk | 1,786 (357,200/max tx) |
59+
| Write 1 ledger entry | 10,000 (500,000/max tx) |
60+
| Write 1KB to disk | 3,500 (462'000/max tx) |
61+
| 1KB of transaction size (bandwidth) | 1,624 (214,368/max tx) |
62+
| 1KB of transaction size (history) | 16,235 (2,143,020/max tx) |
63+
| 1KB of Events/return value | 10,000 (160,000/max tx) |
64+
| 30 days of rent for 1 KB of persistent storage | ~427,000 |
65+
| 30 days of rent for 1 KB of temporary storage | ~213,500 |
66+
67+
Note, that the rent fees provided here may go up in case if a lot of contract data is written to the ledger within a short time period. This happens because the rent fees are designed in such a way that the closer the state size to some validator-defined threshold, the more expensive it gets to write new data or extend the TTLs.

0 commit comments

Comments
 (0)