Skip to content

Commit

Permalink
Merge pull request #69 from matter-labs/jrigada-docs-add-gas-paramete…
Browse files Browse the repository at this point in the history
…rs-docs

docs: Add documentation of customizable gas parameters
  • Loading branch information
Jrigada authored Jan 24, 2025
2 parents 793e664 + bb85019 commit dbcd28e
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/zksync-specifics/gas.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,15 @@ From the params above, we can get all gas-related values used in the transaction
* `gasPerPubdata`: `fairPubdataPrice / baseFee`.

`L1_GAS_PER_PUBDATA_BYTE` and `MAX_L2_GAS_PER_PUBDATA` are system constants currently set to `17` and `50_000`, respectively.

#### Customizing gas values
Some gas parameters can be customized when broadcasting transactions with `forge script` by using the following flags:

* `--with-gas-price-price`: sets `max_fee_per_gas` to be used in the transaction.
* `--priority-gas-price`: sets `max_priority_fee_per_gas` to be used in the transaction.
* `--zk-gas-per-pubdata`: sets `gasPerPubdata` to be used in the transaction.

Example:
```sh
forge script script/NFT.s.sol:MyScript --fork-url http://localhost:8545 --broadcast --with-gas-price-price 370000037 --priority-gas-price 10000 --zk-gas-per-pubdata 3241
```

0 comments on commit dbcd28e

Please sign in to comment.