From 4886221074103d82c421555379c56d5cc1f7567b Mon Sep 17 00:00:00 2001 From: Jakob Meier Date: Fri, 2 Jun 2023 18:06:39 +0200 Subject: [PATCH] update NEP-455: storage compute costs for v61 (#477) Tracks the newly introduced compute costs for protocol version 61 --- neps/nep-0455.md | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/neps/nep-0455.md b/neps/nep-0455.md index 062589530..9699f1458 100644 --- a/neps/nep-0455.md +++ b/neps/nep-0455.md @@ -231,6 +231,31 @@ This NEP was approved by Protocol Working Group members on March 16, 2023 ([meet - [Marcelo's vote](https://github.com/near/NEPs/pull/455#pullrequestreview-1340887413) - [Marcin's vote](https://github.com/near/NEPs/pull/455#issuecomment-1471882639) +### 1.0.1 - Storage Related Compute Costs + +Add five compute cost values for protocol version 61 and above. + +- wasm_touching_trie_node +- wasm_storage_write_base +- wasm_storage_remove_base +- wasm_storage_read_base +- wasm_storage_has_key_base + +For the exact values, please refer to the table at the bottom. + +The intention behind these increased compute costs is to address the issue of +storage accesses taking longer than the allocated gas costs, particularly in +cases where RocksDB, the underlying storage system, is too slow. These values +have been chosen to ensure that validators with recommended hardware can meet +the required timing constraints. +([Analysis Report](https://github.com/near/nearcore/issues/8006)) + +The protocol team at Pagoda is actively working on optimizing the nearcore +client storage implementation. This should eventually allow to lower the compute +costs parameters again. + +Progress on this work is tracked here: https://github.com/near/nearcore/issues/8938. + #### Benefits - Among the alternatives, this is the easiest to implement. @@ -250,3 +275,13 @@ Copyright and related rights waived via [CC0](https://creativecommons.org/public - https://gov.near.org/t/proposal-gas-weights-to-fight-instability-to-due-to-undercharging/30919 - https://github.com/near/nearcore/issues/8032 + +## Live Compute Costs Tracking + +Parameter Name | Compute / Gas factor | First version | Last version | Tracking issue | +-------------- | -------------------- | ------------- | ------------ | -------------- | +wasm_touching_trie_node | 6.83 | 61 | *TBD* | [nearcore#8938](https://github.com/near/nearcore/issues/8938) +wasm_storage_write_base | 3.12 | 61 | *TBD* | [nearcore#8938](https://github.com/near/nearcore/issues/8938) +wasm_storage_remove_base | 3.74 | 61 | *TBD* | [nearcore#8938](https://github.com/near/nearcore/issues/8938) +wasm_storage_read_base | 3.55 | 61 | *TBD* | [nearcore#8938](https://github.com/near/nearcore/issues/8938) +wasm_storage_has_key_base | 3.70 | 61 | *TBD* | [nearcore#8938](https://github.com/near/nearcore/issues/8938)