From 6e2a41e60625c9d2f96e5b5b7ad739698294a18d Mon Sep 17 00:00:00 2001 From: ArielElp <86294909+ArielElp@users.noreply.github.com> Date: Tue, 12 Mar 2024 09:49:38 +0200 Subject: [PATCH] fix: add felt size multiplier to data gas usage (#1174) * add_felt_size.adoc * Apply suggestions from code review Co-Authored-By: Steve Goodman <39279277+stoobie@users.noreply.github.com> --- .../pages/Network_Architecture/fee-mechanism.adoc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/Starknet/modules/architecture_and_concepts/pages/Network_Architecture/fee-mechanism.adoc b/components/Starknet/modules/architecture_and_concepts/pages/Network_Architecture/fee-mechanism.adoc index 22b612f59a..88ddde2bb6 100644 --- a/components/Starknet/modules/architecture_and_concepts/pages/Network_Architecture/fee-mechanism.adoc +++ b/components/Starknet/modules/architecture_and_concepts/pages/Network_Architecture/fee-mechanism.adoc @@ -24,7 +24,7 @@ F = \; & \text{gas_price}\cdot\Bigg(\max_k v_k w_k + \\ & \quad + \; \text{message_calldata_cost}\cdot\left(3t + \sum\limits_{i=1}^t q_i\right) + \\ & \quad + \; \text{l1_storage_write_cost}\cdot t + \\ & \quad + \; \text{l2_payload_costs}\Bigg) + \\ -& \text{data_gas_price}\cdot\bigg(2(n-1)+2(m-1) + \ell +2D \bigg) +& \text{data_gas_price}\cdot\text{felt_size_in_bytes}\cdot\bigg(2(n-1)+2(m-1) + \ell +2D \bigg) \end{align} ++++ @@ -47,6 +47,7 @@ For more information see xref:#calculation_of_computation_costs[Calculation of c * stem:[$\text{message_calldata_cost}$] is 512 gas per 32-byte word. For more details, see xref:#l_2-l_1_messages[]. * stem:[$\text{l1_storage_write_cost}$] is the cost of writing a to a new storage slot on Ethereum, which is 20,000 gas. The reason it appears here is that the hash of an L2->L1 message needs to be recorded on the Starknet core contract on L1. * stem:[$\text{l2_payload_costs}$] is the gas cost of data sent over L2. This includes calldata, code, and event emission. For more details see xref:#l2_calldata[]. +* stem:[$\text{felt_size_in_bytes}$] is 32, which is the number of bytes required to encode a single STARK field element. [#overall_fee_calldata] === Overall transaction fee with calldata