From 66130f4b5cf1730026ab8134d863abec2d326d93 Mon Sep 17 00:00:00 2001 From: Tao Zhu Date: Wed, 4 Sep 2024 17:33:36 -0500 Subject: [PATCH 1/4] draft --- .../simd-XXXX-lower-default-per-ix-cost.md | 109 ++++++++++++++++++ 1 file changed, 109 insertions(+) create mode 100644 proposals/simd-XXXX-lower-default-per-ix-cost.md diff --git a/proposals/simd-XXXX-lower-default-per-ix-cost.md b/proposals/simd-XXXX-lower-default-per-ix-cost.md new file mode 100644 index 000000000..b49667a53 --- /dev/null +++ b/proposals/simd-XXXX-lower-default-per-ix-cost.md @@ -0,0 +1,109 @@ +--- +simd: 'XXXX' +title: Reduce default CU per instruction to zero +authors: + - Tao Zhu (Anza) +category: Standard +type: Core +status: Draft +created: 2024-08-30 +feature: +supersedes: +superseded-by: +extends: +--- + +## Summary + +The `DEFAULT_INSTRUCTION_COMPUTE_UNIT_LIMIT` was originally defined for +worst-case scenarios at 200,000 CUs per instruction. This proposal suggests +reducing it to zero per instruction. + +## Motivation + +1. Reducing Overestimation for Better Block Packing: +The current DEFAULT_INSTRUCTION_COMPUTE_UNIT_LIMIT is set at a conservative +200,000 CUs per instruction to account for worst-case scenarios. However, this +overestimation leads to excessive reservation of block resources, resulting in +underutilized blocks. By gradually reducing this limit, we can better align the +allocated compute units with actual usage, leading to more efficient block +packing. This change will optimize resource allocation, enabling the production +of more densely packed blocks and improving overall system performance. + +2. Encouraging Accurate Compute Unit Requests: +The high default compute unit limit has allowed users to be less precise in +their compute unit requests, often resulting in inefficient resource usage. +By lowering the DEFAULT_INSTRUCTION_COMPUTE_UNIT_LIMIT, we encourage users to +explicitly request the amount of compute units needed for their transactions. +This shift towards more accurate compute unit requests will gradually foster a +more efficient and predictable compute unit allocation paradigm, benefiting +both developers and the network by ensuring that transactions are appropriately +budgeted and that resources are optimally utilized. + +## Alternatives Considered + +1. Lowering the Default to an Arbitrary Value: +One alternative is to reduce the DEFAULT_INSTRUCTION_COMPUTE_UNIT_LIMIT to an +arbitrary value, such as 20,000 CUs per instruction, based on current network +statistics. While this approach could address the overestimation issue in the +short term, it may not be sustainable as network conditions evolve. The chosen +value may become inadequate in the future, necessitating further adjustments. +Additionally, this approach does little to encourage users to explicitly +request the compute units needed for their transactions, meaning it fails to +address the second motivation of promoting more accurate compute unit requests. + +2. Increasing Block Limits While Keeping Account Limits Unchanged: +Another alternative is to increase the overall block limits while keeping +account limits unchanged. This could superficially solve the overestimation +issue by allowing more transactions per block. However, this approach only +alleviates the problem temporarily and does not address the root cause. It also +does not promote the transition toward a more accurate compute unit requesting +paradigm, as users would still not be incentivized to precisely define their +compute unit needs. + +## New Terminology + +None + +## Detailed Design + +1. Target Value Reduction: +Set the target value for DEFAULT_INSTRUCTION_COMPUTE_UNIT_LIMIT to zero. + +2. Scheduled Ramp-Down: +Implement a gradual reduction toward the target value by decreasing +DEFAULT_INSTRUCTION_COMPUTE_UNIT_LIMIT by 20,000 CUs per epoch. This phased +approach gives developers time to adjust to the new limits. + +3. Final Removal: +Once the target value of zero is reached, remove +DEFAULT_INSTRUCTION_COMPUTE_UNIT_LIMIT entirely from the system. + + +### Note: + +When reached to target default, cost tracking can be switched to ALWAYS use +requested CUs. + +## Impact + +1. Increased Block Density: +The proposal will lead to more densely packed blocks, increasing revenue for +block producers. + +2. Developer Adjustments: +Developers will be more inclined to explicitly include set-compute-unit-limit +for their transactions, ensuring accurate compute unit allocation. + +3. No Impact on Simple Transactions: +Simple transactions, such as transfers, and other builtin-only transactions +like voting, will remain unaffected. These transactions will continue to +function without the need for explicit set-compute-unit-limit settings, +especially after the implementation of SIMD-0170. + +## Security Considerations + +Both Agave and FD clients should implement this proposal to avoid breaking +consensus. + + From 6064a3e46117719bb244e0f8782746896bdad08e Mon Sep 17 00:00:00 2001 From: Tao Zhu Date: Wed, 4 Sep 2024 17:40:22 -0500 Subject: [PATCH 2/4] add simd number --- ...lt-per-ix-cost.md => simd-0172-lower-default-per-ix-cost.md} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename proposals/{simd-XXXX-lower-default-per-ix-cost.md => simd-0172-lower-default-per-ix-cost.md} (99%) diff --git a/proposals/simd-XXXX-lower-default-per-ix-cost.md b/proposals/simd-0172-lower-default-per-ix-cost.md similarity index 99% rename from proposals/simd-XXXX-lower-default-per-ix-cost.md rename to proposals/simd-0172-lower-default-per-ix-cost.md index b49667a53..823ebded6 100644 --- a/proposals/simd-XXXX-lower-default-per-ix-cost.md +++ b/proposals/simd-0172-lower-default-per-ix-cost.md @@ -1,5 +1,5 @@ --- -simd: 'XXXX' +simd: '0172' title: Reduce default CU per instruction to zero authors: - Tao Zhu (Anza) From c171fea8a1a8285b5ae5fd1bc320ebe1135f7819 Mon Sep 17 00:00:00 2001 From: Tao Zhu Date: Thu, 5 Sep 2024 17:53:48 -0500 Subject: [PATCH 3/4] add tx size limits to Impact --- proposals/simd-0172-lower-default-per-ix-cost.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/proposals/simd-0172-lower-default-per-ix-cost.md b/proposals/simd-0172-lower-default-per-ix-cost.md index 823ebded6..d1f6d84ca 100644 --- a/proposals/simd-0172-lower-default-per-ix-cost.md +++ b/proposals/simd-0172-lower-default-per-ix-cost.md @@ -92,8 +92,11 @@ The proposal will lead to more densely packed blocks, increasing revenue for block producers. 2. Developer Adjustments: -Developers will be more inclined to explicitly include set-compute-unit-limit -for their transactions, ensuring accurate compute unit allocation. +Developers will be more inclined, or even required, to explicitly use +`set-compute-unit-limit` for their transactions to ensure accurate compute unit +allocation. However, adding compute-budget instructions reduces the available +space within the 1232-byte transaction limit, which could pose challenges for +some developers. 3. No Impact on Simple Transactions: Simple transactions, such as transfers, and other builtin-only transactions From 0eccbe9e891e66657b4d95305d6a5d0139bcd564 Mon Sep 17 00:00:00 2001 From: Tao Zhu Date: Thu, 29 May 2025 13:41:25 -0500 Subject: [PATCH 4/4] lint --- proposals/simd-0172-lower-default-per-ix-cost.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proposals/simd-0172-lower-default-per-ix-cost.md b/proposals/simd-0172-lower-default-per-ix-cost.md index d1f6d84ca..7994fa352 100644 --- a/proposals/simd-0172-lower-default-per-ix-cost.md +++ b/proposals/simd-0172-lower-default-per-ix-cost.md @@ -5,7 +5,7 @@ authors: - Tao Zhu (Anza) category: Standard type: Core -status: Draft +status: Review created: 2024-08-30 feature: supersedes: