-
Notifications
You must be signed in to change notification settings - Fork 234
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: private da gas metering (#6103)
# Context At the end of the private kernel, we either use the `PrivateKernelTail` or `PrivateKernelTailToPublic`: if `PrivateKernelTail`, we are heading straight to the base rollup because there is no public component and we have a `CombinedAccumulatedData` struct as part of the public inputs, called `end`, which has a `gas_used` (which has L2 and DA gas); if `PrivateKernelTailToPublic`, there is a public component, so we split the side effects from private execution into `end` and `end_non_revertible`, each of which has a `gas_used`. Without this change, we were only populating `end.gas_used` to be equal to the `teardown_gas` which the used supplied for the transaction. # With this change ## In `PrivateKernelTail` We compute the amount of "metered gas" in the PrivateAccumulatedDataBuilder. This returns the amount of DA and L2 gas the transaction has consumed as part of private execution. L2 gas is presently zero, but that will likely change (see the warning under the L2 gas section [here](https://docs.aztec.network/protocol-specs/gas-and-fees/fee-schedule)). To this metered `Gas`, it adds the teardown gas and a "tx overhead" `Gas`, which represents flat, fixed costs associated with every transaction; it "tx overhead" presently just has a DA component. ## In `PrivateKernelTailToPublic` We now sum "metered" gas associated with side effects while splitting non/revertible side effects. The revertible gas used is initialized with the teardown gas, and the "tx overhead" gas is added to non_revertible. See [spec](https://docs.aztec.network/protocol-specs/gas-and-fees/fee-schedule) for more info.
- Loading branch information
1 parent
784d542
commit 1a8f372
Showing
9 changed files
with
135 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.