Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: 0.13.1 fee updates #1162

Merged
merged 3 commits into from
Mar 6, 2024
Merged

docs: 0.13.1 fee updates #1162

merged 3 commits into from
Mar 6, 2024

Conversation

ArielElp
Copy link
Collaborator

@ArielElp ArielElp commented Mar 5, 2024

Description of the Changes

Starknet v0.13.1 allows state diff to be sent to L1 via blobs instead of calldata. This change should be reflected in the final fee formula.

Additionally, L2 calldata, events, and code are now priced. These new prices should also appear in the fee mechanism page.

PR Preview URL

https://starknet-io.github.io/starknet-docs/pr-1162/documentation/architecture_and_concepts/Network_Architecture/fee-mechanism/

Check List

  • Changes have been done against main branch, and PR does not conflict
  • PR title follows the convention: <docs/feat/fix/chore>(optional scope): <description>, e.g: fix: minor typos in code

This change is Reviewable

@ArielElp ArielElp requested a review from leo-starkware March 5, 2024 17:57
Copy link

github-actions bot commented Mar 5, 2024

Your preview build is ready! ✨ Check the following link in 1-2 minutes: https://starknet-io.github.io/starknet-docs/pr-1162/documentation/ .

@@ -7,24 +7,24 @@ This section describes fees that are paid on L2 starting in Starknet 0.13.0. For
[#overall_fee]
== Overall transaction fee

From Starknet v0.13.1 onwards, we destinguish between blocks whose state diffs are sent to L1 as calldata, and blocks whose state diffs are sent to L1 as blobs (the `l1_da_mode` property in Starknet block headers determines this). The cost of computation remains the same on both options, but the cost related to data availability differs.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo: destinguish


Users can specify the maximum fee that they are willing to pay for a transaction.
With v3 transactions, users specifiy the max amount and max price for each resource. At the time of writing, the only available resource is L1 gas. In the future, we will introduce L2 gas which will be used to price L2 work (as opposed to only charging for the proof verification in L1 gas, which is what happens today).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo: specifiy


include::partial$snippet_v3_max_price_sidebar.adoc[]
[#deprecated_fee_limitations]
=== Deprecated transactions (verion < 3)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo: verion


For transaction versions before v3 transactions, the `max_fee` field specifies the maximum fee.
With older transactio versions, users specify the maximum fee that they are willing to pay for a transaction.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo: transactio


* xref:#computation_without_builtins[Computational complexity]: A transaction's portion of the proof verification cost is proportional to its complexity.
* xref:#onchain_data_components[Onchain data]: L1 calldata cost originating from xref:Network_Architecture/on-chain-data.adoc[data availability] and L2→L1 messages.
At the time of writing, the following components are contributing to the transacation fee:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo: transacation

At the time of writing, the following components are contributing to the transacation fee:

* xref:#computation_without_builtins[Computational complexity]: The marginal cost of verifying the transaction on L1, measured in L1 gas.
* xref:#onchain_data_components[Onchain data]: The cost of posting the state diffs induced by the transaction to L1 (for more details, see xref:Network_Architecture/on-chain-data.adoc[data availability]). This is measured in L1 gas or L1 data gas, depending on whether or not the L2 block in which the transaction was included uses blobs or calldata.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be: uses calldata or blobs.

Copy link
Collaborator Author

@ArielElp ArielElp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 0 of 3 files reviewed, 5 unresolved discussions (waiting on @leo-starkware)


components/Starknet/modules/architecture_and_concepts/pages/Network_Architecture/fee-mechanism.adoc line 49 at r1 (raw file):

Previously, leo-starkware wrote…

And same below

Done.


components/Starknet/modules/architecture_and_concepts/pages/Network_Architecture/fee-mechanism.adoc line 71 at r1 (raw file):

Previously, leo-starkware wrote…

"as in"

Done.


components/Starknet/modules/architecture_and_concepts/pages/Network_Architecture/fee-mechanism.adoc line 93 at r1 (raw file):

Previously, leo-starkware wrote…

"exactly the amount of the formula": syscalls don't appear though, so I'm not sure about the word "exactly"

Changed the wording a bit (one can argue it's included in the step count, that's how we measure it today)


components/Starknet/modules/architecture_and_concepts/pages/Network_Architecture/fee-mechanism.adoc line 100 at r1 (raw file):

Previously, leo-starkware wrote…

should be: uses calldata or blobs.

Done.


components/Starknet/modules/architecture_and_concepts/pages/Network_Architecture/fee-mechanism.adoc line 101 at r1 (raw file):

Previously, leo-starkware wrote…

I propose: "sent to the Starknet core contract as L1 calldata by the sequencer; therefore L2 transaction that send L2->L1 messages incur an additional L1 gas cost."

Done.

Copy link

github-actions bot commented Mar 6, 2024

Your preview build is ready! ✨ Check the following link in 1-2 minutes: https://starknet-io.github.io/starknet-docs/pr-1162/documentation/ .

Copy link
Collaborator

@leo-starkware leo-starkware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line 267: storage_write_cost needs to be l1_storage_write_cost

@ArielElp ArielElp merged commit 720103f into main Mar 6, 2024
3 of 4 checks passed
@ArielElp ArielElp deleted the 0.13.1_fees_update branch March 6, 2024 14:13
xiaolou86 pushed a commit to xiaolou86/starknet-docs that referenced this pull request Apr 7, 2024
* add 0.13.1 fee updates

* better description for declared classes

* fix typos and change wording
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants