|
| 1 | +## Preamble |
| 2 | + |
| 3 | +``` |
| 4 | +SLP: To Be Assigned |
| 5 | +Title: <SLP title> |
| 6 | +Working Group: |
| 7 | + Owner: <Person accountable for the SLP - name/email address/github alias> |
| 8 | + Authors: <List of comma separated name/email address/github alias> |
| 9 | + Consulted: <List of comma separated name/email address/github alias> |
| 10 | +Status: Draft |
| 11 | +Created: <date created on, in ISO 8601 (yyyy-mm-dd) format> |
| 12 | +Discussion: <link to where discussion for this SLP is taking place, typically the mailing list> |
| 13 | +Protocol version: TBD |
| 14 | +``` |
| 15 | + |
| 16 | +## Simple Summary |
| 17 | + |
| 18 | +A short, layman-accessible explanation of the proposed limit change(s): which resource(s) are being |
| 19 | +adjusted and at a high level, why. |
| 20 | + |
| 21 | + |
| 22 | +## Motivation |
| 23 | + |
| 24 | +The increase in resources should generally be motivated by demand. However, the notion of demand |
| 25 | +differs for ledger-wide and per-transaction limits. Note that 'demand' doesn't mean that a limit |
| 26 | +will be increased, it's just a motivation to consider the increase at all. |
| 27 | + |
| 28 | +- For ledger-wide limits, _the demand can be identified by sufficiently high surge pricing rate due |
| 29 | + to transactions not fitting into a certain limit_, or at least a significant percentage of |
| 30 | + ledgers being near the resource limit |
| 31 | + - This is a reactive approach. There is a possibility that the Core team might need to take a |
| 32 | + proactive approach and increase the limits in preparation for launching a protocol that is |
| 33 | + expected to have high TPS (i.e. not in response to the existing network activity). This should |
| 34 | + rather be an exception though. |
| 35 | + - When the per-transaction limits are increased, it might be necessary to also increase the |
| 36 | + respective ledger-wide limits in order to maintain a high enough ratio between the limits. |
| 37 | +- For per-transaction limits, the demand is based on the needs of the protocols that run on |
| 38 | + Soroban. |
| 39 | + - It's not realistic to support each and every possible protocol, but in general Soroban should |
| 40 | + provide the capabilities for implementing the majority of protocols that exist on the other |
| 41 | + blockchains, with as little exceptions as possible. |
| 42 | + - More specifically, we should first and foremost look for the protocols that align with the |
| 43 | + Stellar chain goals like any other permanent protocol changes (see CAP process). |
| 44 | + - Contract developers have some room for optimization. That said, it would be preferential to |
| 45 | + have optimization just impact the costs and not to be a hard requirement for doing more |
| 46 | + complex things on Soroban. |
| 47 | + |
| 48 | +### Goals Alignment |
| 49 | + |
| 50 | +Reference the [Stellar Network goals](core/README.md#stellar-network-goals) that this proposal |
| 51 | +advances. If the demand stems from a specific ecosystem use case, describe how that use case |
| 52 | +aligns with those goals. |
| 53 | + |
| 54 | +## Proposed Changes |
| 55 | + |
| 56 | +Specify the resource(s) and the desired new limit value(s). For each affected limit, include: |
| 57 | + |
| 58 | +- The current value and the proposed new value. |
| 59 | +- Whether the limit is per-transaction, ledger-wide, or both. |
| 60 | +- If proposing a per-transaction limit increase, whether the corresponding ledger-wide limit also |
| 61 | + needs to be raised to maintain a healthy ledger/transaction ratio (see |
| 62 | + [Transactions per ledger ratio](#transactions-per-ledger-ratio)). |
| 63 | + |
| 64 | +## Impact Assessment |
| 65 | + |
| 66 | +To the extent possible, describe the expected impact of the change on the network and downstream |
| 67 | +systems (indexers, RPC providers, block explorers, etc.). The subsections below describe the |
| 68 | +factors the Core team will use to evaluate the proposal; authors should address whichever apply |
| 69 | +to the resources being changed. |
| 70 | + |
| 71 | + |
| 72 | +## Justification of the Proposed Numbers |
| 73 | + |
| 74 | +Based on the demand identified in the Motivation section, explain how the specific values in |
| 75 | +Proposed Changes were chosen. The Core team will evaluate the numbers using the following |
| 76 | +guidelines; authors are encouraged to address them up front. |
| 77 | + |
| 78 | +**Identifying the resources in demand** |
| 79 | + |
| 80 | +There are a few options for justifying that a limit needs to change: |
| 81 | + |
| 82 | +- Based on ecosystem requests (may affect both per-transaction and ledger-wide limits) |
| 83 | + - Ecosystem requests should demonstrate the necessity of the increase, specifically: |
| 84 | + - How the protocol aligns with Stellar goals (similar to CAP alignment section) |
| 85 | + - Why the existing limits are not sufficient (e.g. protocol requirements upper bound is clearly |
| 86 | + above the existing limit) |
| 87 | +- For ledger-wide limits, based on the observed ledger utilization |
| 88 | + - E.g. the resource is at 90+% of capacity for 10+% of the ledgers |
| 89 | + - While it's intentional for some ledgers to be surge priced (especially in case of |
| 90 | + spam/arbitrage activity), it's important to analyze the network activity and scale up in |
| 91 | + case of actual organic growth (or to at least allow non-spammy traffic to be applied as |
| 92 | + well) |
| 93 | +- For per-transaction limits, based on the network usage patterns |
| 94 | + - E.g. the resource is at 80+% of transaction limit for 10+% of transactions |
| 95 | + - Besides straightforward indication of the presence of more complex protocols on the network, |
| 96 | + we need to keep custom accounts in mind - using a protocol that's already 'on the edge' of |
| 97 | + the resource limit may be simply impossible for some custom accounts, which is why some |
| 98 | + leeway is necessary |
| 99 | +- Based on Core protocol advancements |
| 100 | + - E.g. we should be able to 'fix' the write limit ratios with the full launch of State Archival |
| 101 | + |
| 102 | +**Coming up with the desired numbers** |
| 103 | + |
| 104 | +Even if there is a straightforward request (e.g. raise a certain per-transaction limit by 50%), we |
| 105 | +need to consider increasing the respective ledger limit in order to maintain a high enough ratio. |
| 106 | +Some basic rule ideas: |
| 107 | + |
| 108 | +- For the ledger capacity (in case of resource causing surge pricing), we can go with as high a |
| 109 | + value as technically feasible within e.g. 2x of the current limit. |
| 110 | +- For the per-transaction capacity, aim at making an increase that would make 95+% of transactions |
| 111 | + have <70% resource utilization. |
| 112 | +- Maintain the ledger/transaction ratio high enough. |
| 113 | + - 5x is a reasonable lower bound. |
| 114 | + - Until the lower ratios from the initial launch have been fixed, we should try to at least not |
| 115 | + reduce these further. |
| 116 | + |
| 117 | +## Evaluation Notes |
| 118 | + |
| 119 | +This section is primarily filled in by the Core team during the |
| 120 | +["Awaiting Evaluation"](limits/README.md) phase, but authors may pre-populate any benchmarking, |
| 121 | +modeling, or downstream-impact data they already have. |
| 122 | + |
| 123 | +The proposed numbers have to be thoroughly verified against the actual network capabilities. Note |
| 124 | +that the whole limits-increase process assumes that the network doesn't operate at the full |
| 125 | +potential capacity at the moment, e.g. due to performance optimizations or just due to conservative |
| 126 | +current limits. |
| 127 | + |
| 128 | +- Most of the ledger-wide limits can be evaluated via apply-time benchmarks. |
| 129 | + - The goal is to be able to close 95+% of the ledgers within N ms on a model validator (where N |
| 130 | + is a moving target that is based on the available processing time for closing the ledgers). |
| 131 | + Currently the tentative value of N is 500 ms. |
| 132 | + - 'Model validator' is a bit imprecise, but we can't benchmark every validator on one hand and |
| 133 | + expect them to have a proportional change in apply time on the other. |
| 134 | + - Note that N might need to go _down_ together with the ledger-wide limits in case we |
| 135 | + prioritize the ledger close latency over individual ledger throughput. The important |
| 136 | + implication is that this adds a potential future limit to maximum _per-transaction_ limits. |
| 137 | + This just reinforces the requirements around maintaining high enough ledger/transaction |
| 138 | + ratios, though in this case it's likely mostly relevant for the resources that impact the |
| 139 | + ledger close time the most (CPU instructions, read entries). |
| 140 | +- Going forward we might also consider additional evaluations based on models (such as |
| 141 | + [this](https://github.com/stellar/stellar-core/blob/master/scripts/resource-calc.ipynb)), though |
| 142 | + this will likely only become relevant when we start getting closer to the hardware limits. |
| 143 | +- The transaction size limits (both per-ledger and per-transaction) need to be exercised in |
| 144 | + Supercluster tests to ensure there is no significant flooding TPS degradation. |
| 145 | +- In case of changes that impact the downstream teams significantly, come up with estimated impact |
| 146 | + and reach out to the affected parties for approval (such as indexers, RPC providers, block |
| 147 | + explorers, etc.). |
| 148 | +- In case of less tangible long term impact, evaluate on a case-by-case basis. |
| 149 | + - For example, in case of instructions we need to care about the ratio between the _sequential_ |
| 150 | + per-ledger instructions and per-transaction instructions and keep it high enough (say, at |
| 151 | + least 4x). |
| 152 | + - We also need to care about some known limitations of the future protocols, e.g. synchronization |
| 153 | + stages in the proposed parallelization approach introduce yet another limit on maximum |
| 154 | + per-transaction instructions. |
| 155 | + - We should be able to use benchmarking capabilities to ensure that per-transaction limits are |
| 156 | + compatible with future work. As of right now, we would be looking at a "stage" taking in the |
| 157 | + order of 125ms (with a stage having enough capacity for 2-3 transactions as to ensure a sane |
| 158 | + ratio at the ledger level). Benchmarks can be run using stage limits as ledger limits and |
| 159 | + ensure that timing goals are met. |
| 160 | + - This doesn't mean though that we can't also work around these issues while designing the |
| 161 | + protocol changes. |
| 162 | + |
| 163 | +The evaluation may have several outcomes: |
| 164 | + |
| 165 | +- Everything is within the acceptable bounds, the proposal goes through unchanged. |
| 166 | +- Limits can be increased only to a fraction of the desired number - modify the proposal |
| 167 | + respectively. |
| 168 | + - This often may still be a satisfactory outcome, given that in a lot of cases any increase |
| 169 | + should improve the situation (e.g. reduce the surge pricing rate or reduce the risk of custom |
| 170 | + account not being able to interact with a protocol). |
| 171 | +- The limits can't be increased at all or can be moved just marginally - the proposal has to be |
| 172 | + rejected and reviewed again if/when Core is better suited to handle it. |
| 173 | + |
| 174 | +## Security Concerns |
| 175 | + |
| 176 | +Describe any security implications of the proposed change. If the change has no material new |
| 177 | +security concerns, briefly explain why (for example, because resource accounting and metering |
| 178 | +semantics are unchanged and only numeric ceilings are adjusted). |
0 commit comments