-
Notifications
You must be signed in to change notification settings - Fork 298
feat:add setting min base fee guide #1849
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| --- | ||
| title: Set the Minimum Base Fee | ||
| description: Learn how to set a minimum base fee on your OP-Stack Chain | ||
| --- | ||
|
|
||
| ## Overview | ||
|
|
||
| | Parameter | Type | Default | Recommended | Max Allowed for Standard Chains | Units | | ||
| | ---------- | ---- | -------- | ------------ | ------------ | ------ | | ||
| | <code>minBaseFee</code> | Number | 0 (disabled) | 100,000 | 10,000,000,000 | wei | | ||
|
|
||
| The <strong>Minimum Base Fee</strong> (`minBaseFee`) configuration was introduced in the <strong>Jovian</strong> release of the OP Stack. | ||
ZakAyesh marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| This feature allows chain operators to specify a minimum L2 base fee to maintain a predictable minimum transaction costs and avoids excessively long priority fee auctions that can occur when the base fee falls too low. | ||
ZakAyesh marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| One situation where the minimum base fee may kick in, is when the [batcher is throttled](https://docs.optimism.io/chain-operators/guides/configuration/batcher#batcher-sequencer-throttling) for long enough. If the minBaseFee isn't enabled, the base fee can drop all the down to 1 wei, which can take awhile to recover back to a stable base fee. | ||
ZakAyesh marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
|
|
||
| The steps below explain how to update the `minBaseFee` parameter on-chain using the <code>SystemConfig</code> contract. | ||
|
|
||
| <Info> | ||
ZakAyesh marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| Setting the `minBaseFee` too high may make transactions harder to include for users. | ||
| </Info> | ||
|
|
||
|
|
||
| ## How to Update the Minimum Base Fee | ||
|
|
||
| <Steps> | ||
| <Step title="Find your SystemConfig contract address"> | ||
| The [SystemConfig](https://specs.optimism.io/protocol/system-config.html) contract stores configurable protocol parameters such as gas limits and fee settings. | ||
| You can find its proxy address in the [state.json generated by op-deployer](https://docs.optimism.io/chain-operators/tutorials/create-l2-rollup/op-deployer-setup#deploy-l1-contracts). | ||
| </Step> | ||
|
|
||
| <Step title="Call the setMinimumBaseFee() method"> | ||
| To update the minimum base fee, call the following method on the `SystemConfig` contract: | ||
|
|
||
| `setMinBaseFee(uint64 minBaseFee) external onlyOwner;` | ||
| <Info> | ||
ZakAyesh marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| Note that the owner of the `SystemConfig` contract is the [System Config Owner address](https://docs.optimism.io/chain-operators/reference/privileged-roles#system-config-owner), so this transaction must be sent from that address. | ||
| </Info> | ||
| Example (using [cast](https://getfoundry.sh/cast/reference/cast/)): | ||
|
|
||
| ``` | ||
| cast send <SYSTEM_CONFIG_PROXY_ADDRESS> "setMinBaseFee(uint64)" 100000 | ||
| ``` | ||
| </Step> | ||
|
|
||
| <Step title="Verify the new value"> | ||
| After the transaction confirms, verify the current value by calling the following getter method on the `SystemConfig` contract: | ||
|
|
||
| `function minBaseFee() external view returns (uint64);` | ||
|
|
||
| Example (using [cast](https://getfoundry.sh/cast/reference/cast/)): | ||
|
|
||
| ``` | ||
| cast call <SYSTEM_CONFIG_PROXY_ADDRESS> "minBaseFee()" | ||
| ``` | ||
| </Step> | ||
| </Steps> | ||
|
|
||
| --- | ||
|
|
||
| ## References | ||
|
|
||
| * [Minimum Base Fee Configuration Spec](https://specs.optimism.io/protocol/jovian/system-config.html#minimum-base-fee-configuration) | ||
| * [Jovian Upgrade Spec](https://specs.optimism.io/protocol/jovian/overview.html) | ||
| * [SystemConfig Contract](https://specs.optimism.io/protocol/system-config.html) | ||
ZakAyesh marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| * [Design Doc](https://github.com/ethereum-optimism/design-docs/blob/main/protocol/minimum-base-fee.md) | ||
|
|
||
|
|
||
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.