Skip to content

Commit

Permalink
fix: add felt size multiplier to data gas usage (#1174)
Browse files Browse the repository at this point in the history
* add_felt_size.adoc

* Apply suggestions from code review

Co-Authored-By: Steve Goodman <[email protected]>
  • Loading branch information
ArielElp and stoobie authored Mar 12, 2024
1 parent 1a3527c commit 6e2a41e
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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}
++++

Expand All @@ -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
Expand Down

0 comments on commit 6e2a41e

Please sign in to comment.