Skip to content

Commit

Permalink
use default gas price as the base fee
Browse files Browse the repository at this point in the history
  • Loading branch information
hexoscott committed Oct 2, 2024
1 parent 1fed9ea commit dd9a191
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 2 deletions.
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

0 comments on commit dd9a191

Please sign in to comment.