Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/zkevm' into zkevm-2.60
Browse files Browse the repository at this point in the history
  • Loading branch information
cffls committed Oct 2, 2024
2 parents 03c0aa1 + 0948e33 commit 2a57c69
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 5 deletions.
3 changes: 2 additions & 1 deletion cmd/utils/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,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 @@ -100,7 +100,7 @@ func (f eip1559Calculator) CurrentFees(chainConfig *chain.Config, db kv.Getter)
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
2 changes: 2 additions & 0 deletions consensus/misc/eip1559_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ func copyConfig(original *chain.Config) *chain.Config {
func config() *chain.Config {
config := copyConfig(params.TestChainConfig)
config.LondonBlock = big.NewInt(5)
// setting the default expected fee for tests
config.ZkDefaultGasPrice = params.InitialBaseFee
return config
}

Expand Down
1 change: 1 addition & 0 deletions erigon-lib/chain/chain_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ type Config struct {
NormalcyBlock *big.Int `json:"normalcyBlock,omitempty"`

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

type BorConfig interface {
Expand Down
1 change: 1 addition & 0 deletions eth/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -996,6 +996,7 @@ func New(ctx context.Context, stack *node.Node, config *ethconfig.Config, logger
cfg := backend.config

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

if cfg.Zk.L1CacheEnabled {
Expand Down
8 changes: 5 additions & 3 deletions zk/tests/unwinds/unwind.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ dataPath="./datadir"
firstStop=11204
stopBlock=11315
unwindBatch=70
firstTimeout=120s
secondTimeout=60s

rm -rf "$dataPath/rpc-datadir"
rm -rf "$dataPath/phase1-dump1"
Expand All @@ -31,7 +33,7 @@ timeout 300s go run ./zk/debug_tools/datastream-host --file="$(pwd)/zk/tests/unw
sleep 5

# run erigon for a while to sync to the unwind point to capture the dump
timeout 40s ./build/bin/cdk-erigon \
timeout $firstTimeout ./build/bin/cdk-erigon \
--datadir="$dataPath/rpc-datadir" \
--config=./dynamic-integration8.yaml \
--zkevm.sync-limit=${firstStop}
Expand All @@ -40,7 +42,7 @@ timeout 40s ./build/bin/cdk-erigon \
go run ./cmd/hack --action=dumpAll --chaindata="$dataPath/rpc-datadir/chaindata" --output="$dataPath/phase1-dump1"

# now run to the final stop block
timeout 15s ./build/bin/cdk-erigon \
timeout $secondTimeout ./build/bin/cdk-erigon \
--datadir="$dataPath/rpc-datadir" \
--config=./dynamic-integration8.yaml \
--zkevm.sync-limit=${stopBlock}
Expand All @@ -59,7 +61,7 @@ go run ./cmd/integration state_stages_zkevm \
go run ./cmd/hack --action=dumpAll --chaindata="$dataPath/rpc-datadir/chaindata" --output="$dataPath/phase1-dump2"

# now sync again
timeout 15s ./build/bin/cdk-erigon \
timeout $secondTimeout ./build/bin/cdk-erigon \
--datadir="$dataPath/rpc-datadir" \
--config=./dynamic-integration8.yaml \
--zkevm.sync-limit=${stopBlock}
Expand Down

0 comments on commit 2a57c69

Please sign in to comment.