This repository has been archived by the owner on Aug 21, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update resource limits and make a new reference page for them (#736)
* add a reference page on resource limits and fees * remove resource fee/limit tables from "explainer" page * removing some unnecessary comments and entries Some of the comments are more applicable in the discussion doc, than they are for developer documentation. So, let's get rid of those. * remove unnecessary "current is..." language from resource fees
- Loading branch information
1 parent
927478f
commit 51705b5
Showing
2 changed files
with
86 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
--- | ||
sidebar_position: 35 | ||
title: Resource Limits & Fees | ||
--- | ||
|
||
## Resource Limits | ||
|
||
| Network Setting | Phase 0 (current) | Phase 1 | | ||
| :------------------------------------------------- | :----------------------------------------- | :----------------------------------------------------------------------------------------------------- | | ||
| Soroban Txn per ledger | 1 | 100 | | ||
| Max CPU Instructions per Txn | 2.5 million (2M instructions for max Wasm) | 100 million (VM instantiation consumes up to 23M for a 64KB Wasm, and 46M for multiple Wasms of 130KB) | | ||
| Memory limit per Txn | 2 MB | 40 MB | | ||
| Ledger entry size (including Wasm entries) per Txn | 2 KB | 64 KB | | ||
| Read/Write Ledger entries per Txn | 3 read; 2 write | 40 read; 25 write | | ||
| Read/Write bytes per Txn | 3.2 KB read; 3.2 KB write | 130 KB read; 65 KB write | | ||
| Transaction size | 10 KB | 70 KB | | ||
| Persistent entry minimal/initial lifetime | 4,096 ledgers (~5.68 hours) | 120 days | | ||
| Temporary entry minimal/initial lifetime | 16 ledgers | 1 day | | ||
| Max ledger entry expiration bump | 61 days | 6 months | | ||
| Events+return value size bytes | 200 B | 8 KB | | ||
|
||
## Resource Fees | ||
|
||
Note, that write fees grow linearly from empty ledger to ledger "target size", and then grow linearly, but with a 1000x factor after exceeding the target. This is to bound the ledger size growth. | ||
|
||
The ledger rent cost ('Write 1KB' entries in the table) is based on the write fee, rent period and some coefficient. For the temporary storage, the coefficient is 10 months (in ledgers), thus 1 month of temporary entry rent is 1/10 of the rent fee. For persistent storage the coefficient is 1 month (in ledgers) and thus 1 month of rent is equivalent to the write fee. | ||
|
||
### Phase 0 (current) | ||
|
||
| Network Setting | Phase 0 Cost (stroops) | | ||
| :-------------------------------------------- | :---------------------- | | ||
| 10,000 instructions | 100 (1,000,000/tx) | | ||
| Read 1 ledger entry | 1,000 (20,000/tx) | | ||
| Write 1 ledger entry | 3,000 (30,000/tx) | | ||
| Read 1KB from ledger | 1,000 (127,000/tx) | | ||
| 1KB of transaction (bandwidth) | 500 (34,000/tx) | | ||
| 1KB of transaction (history) | 5,000 (340,000/tx) | | ||
| 1KB of Events/return value | 300 (1,500/tx) | | ||
| “Target” ledger size | 14.5 GB | | ||
| Fee multiplier after reaching the target size | 1,000 | | ||
| Write 1KB to ledger (empty) | 1,000 | | ||
| Write 1KB to ledger (current, 12 GB) | 0.356 XLM (17.4 XLM/tx) | | ||
| Write 1KB to ledger (target, 14 GB) | 0.4 XLM (2.26 XLM/tx) | | ||
| Temp entry rent period | 10 months | | ||
| Persistent entry rent period | 1 month | | ||
| 1 KB of temp storage per month | 400,000 | | ||
| 1 KB of persistent storage per month | 4,000,000 | | ||
|
||
### Phase 1 | ||
|
||
| Network setting | Phase 1 Cost (stroops) | | ||
| :-------------------------------------------- | :--------------------------------------------------------------------------------------------------------------- | | ||
| 10,000 instructions | 25 (250,000/max tx) | | ||
| Read 1 ledger entry | 6,250 (250,000/max tx) | | ||
| Write 1 ledger entry | 10,000 (250,000/max tx) | | ||
| Read 1KB from ledger | 1,786 (250,000/max tx) | | ||
| 1KB of transaction size (bandwidth) | 1,624 (113,642/max tx) | | ||
| 1KB of transaction size (history) | 16,235 (1,136,418/max tx) | | ||
| 1KB of Events/return value | 10,000 (80,000/max tx) | | ||
| “Target” ledger size | 13 GB | | ||
| Fee multiplier after reaching the target size | 1,000 | | ||
| Write 1KB to ledger, stroops (empty) | -1,234,673 (the write cost is always positive; this value is used only for the effective write fee computations) | | ||
| Write 1KB to ledger, stroops (current, 12 GB) | 11,539 (750,000/max tx) | | ||
| Write 1KB to ledger, stroops (target, 13 GB) | 115,390 (7,500,000/max tx) | | ||
| Temp entry rent period, ledgers | 2,804 | | ||
| Persistent entry rent period, ledgers | 1,402 | | ||
| Minimum persistent entry TTL, ledgers | 2,073,600 (120 days) | | ||
| Minimum temp entry TTL, ledgers | 17,280 (~1 day) | | ||
|
||
## Phase 1 Examples | ||
|
||
Here are some examples to put things in perspective (the fees are computed at "current" ledger size and would grow as ledger size increases): | ||
|
||
| Scenario | Phase 1 Cost | | ||
| :------------------------------------------------------------------------------------- | :----------- | | ||
| Upload a new 64KB Wasm (includes 120 day rent payment) | 109.2 XLM | | ||
| 1 year of 64KB Wasm storage rent | 327.7 XLM | | ||
| Bump 64KB Wasm rent by 1 day | 0.91 XLM | | ||
| Modify 64 KB contract data entry without increasing the size | 0.075 XLM | | ||
| Create 100 byte contract data entry, e.g. user balance (includes 120 day rent payment) | 0.17 XLM | | ||
| 1 year of 100 byte storage rent | 0.512 XLM | | ||
| Modify 100 byte contract data entry without increasing the size | 1150 stroops | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters