Skip to content

Commit

Permalink
update NEP-455: storage compute costs for v61 (#477)
Browse files Browse the repository at this point in the history
Tracks the newly introduced compute costs for protocol version 61
  • Loading branch information
jakmeier authored Jun 2, 2023
1 parent ce3e46d commit 4886221
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions neps/nep-0455.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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)

0 comments on commit 4886221

Please sign in to comment.