Skip to content

Commit

Permalink
docs: Updated fees spec in yellow paper (#4624)
Browse files Browse the repository at this point in the history
This PR updates the fees section of the yellow paper. The section should
now be more concise as well as more accurately reflecting the spec after
the recent changes.
  • Loading branch information
PhilWindle authored Feb 15, 2024
1 parent 5d38dc7 commit cdf67ea
Show file tree
Hide file tree
Showing 8 changed files with 402 additions and 334 deletions.
365 changes: 365 additions & 0 deletions yellow-paper/docs/gas-and-fees/fee-payments-and-metering.md

Large diffs are not rendered by default.

26 changes: 26 additions & 0 deletions yellow-paper/docs/gas-and-fees/fee-schedule.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Fee Schedule

:::info
This section is a placeholder, we will flesh this out in much greater detail when we come to profile operations and assign gas costs
:::

<!-- prettier-ignore -->
| Action | Resource Domain | Consumption Calculation | Comment |
| -------- | -------- | -------- | ------- |
| Verifying the private kernel proof | L2 | Fixed L2/Transaction | |
| Verifying each nullifier against the world state | L2 | Fixed L2/Tx nullifier | |
| Verifying each nullifier against others in the same block | L2 | Fixed L2/Tx nullifier | Whilst not strictly a fixed cost, this would need to be allocated as a fixed cost as it depends on the composition of the rollup |
| Verifying log preimages against the sha256 log hashes contained in the private kernel public inputs | L2 | L2 gas per pre-image field | |
| Verifying contract deployment data against the sha256 hash of this data contained in the private kernel public inputs | L2 | L2 gas per hash | |
| Publishing contract data to DA | DA | DA gas per byte | |
| Publishing state updates to DA | DA | DA gas per byte | |
| Publishing notes/tags to DA | DA | DA gas per byte | |
| Publishing L2->L1 messages | L1 | Calldata gas per byte + processing & storing of the message | |
| Public function execution | L2 | L2 gas per function opcode | |
| Proving the public VM circuit for a public function | L2 | Fixed L2/Tx public function | |
| Proving the public kernel circuit for a public function | L2 | Fixed L2/Tx public function | |
| Proving the base rollup circuit | L2 | Fixed L2/Transaction |
| Proving the merge rollup circuit | L2 | Amortized L2/Transaction |
| Proving the root rollup circuit | L2 | Amortized L2/Transaction |
| Publishing the block header to L1 | L1 | Amortized L1/Transaction |
| Verifying the rollup proof | L1 | Amortized L1/Transaction |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
340 changes: 7 additions & 333 deletions yellow-paper/docs/gas-and-fees/index.md

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion yellow-paper/sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,10 @@ const sidebars = {
label: "Gas & Fees",
type: "category",
link: { type: "doc", id: "gas-and-fees/index" },
items: [],
items: [
"gas-and-fees/fee-payments-and-metering",
"gas-and-fees/fee-schedule",
],
},
{
label: "Decentralization",
Expand Down

0 comments on commit cdf67ea

Please sign in to comment.