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

use default gas price as the base fee #1258

Merged
merged 3 commits into from
Oct 2, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions chain/chain_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ type Config struct {
ForkID12BananaBlock *big.Int `json:"forkID12BananaBlock,omitempty"`

AllowFreeTransactions bool `json:"allowFreeTransactions,omitempty"`
ZkDefaultGasPrice uint64 `json:"zkDefaultGasFee,omitempty"`
}

func (c *Config) String() string {
Expand Down
3 changes: 2 additions & 1 deletion cmd/utils/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,8 @@ var (
DefaultGasPrice = cli.Uint64Flag{
Name: "zkevm.default-gas-price",
Usage: "Set the default/min gas price",
Value: 0,
// 0.01 gwei
Value: 10000000,
}
MaxGasPrice = cli.Uint64Flag{
Name: "zkevm.max-gas-price",
Expand Down
2 changes: 1 addition & 1 deletion consensus/misc/eip1559.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func VerifyEip1559Header(config *chain.Config, parent, header *types.Header) err
func CalcBaseFee(config *chain.Config, parent *types.Header) *big.Int {
// If the current block is the first EIP-1559 block, return the InitialBaseFee.
if !config.IsLondon(parent.Number.Uint64()) {
return new(big.Int).SetUint64(params.InitialBaseFee)
return new(big.Int).SetUint64(config.ZkDefaultGasPrice)
}

var (
Expand Down
1 change: 1 addition & 0 deletions eth/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -761,6 +761,7 @@ func New(stack *node.Node, config *ethconfig.Config) (*Ethereum, error) {
cfg := backend.config

backend.chainConfig.AllowFreeTransactions = cfg.AllowFreeTransactions
backend.chainConfig.ZkDefaultGasPrice = cfg.DefaultGasPrice
l1Urls := strings.Split(cfg.L1RpcUrl, ",")

if cfg.Zk.L1CacheEnabled {
Expand Down
Loading