Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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 cmd/geth/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ var (
utils.MinerNoVerifyFlag,
utils.MinerStoreSkippedTxTracesFlag,
utils.MinerMaxAccountsNumFlag,
utils.MinerAllowEmptyFlag,
utils.NATFlag,
utils.NoDiscoverFlag,
utils.DiscoveryV5Flag,
Expand Down
1 change: 1 addition & 0 deletions cmd/geth/usage.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ var AppHelpFlagGroups = []flags.FlagGroup{
utils.MinerNoVerifyFlag,
utils.MinerStoreSkippedTxTracesFlag,
utils.MinerMaxAccountsNumFlag,
utils.MinerAllowEmptyFlag,
},
},
{
Expand Down
7 changes: 7 additions & 0 deletions cmd/utils/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,10 @@ var (
Usage: "Maximum number of accounts that miner will fetch the pending transactions of when building a new block",
Value: math.MaxInt,
}
MinerAllowEmptyFlag = cli.BoolFlag{
Name: "miner.allowempty",
Usage: "Allow sealing empty blocks",
}
// Account settings
UnlockedAccountFlag = cli.StringFlag{
Name: "unlock",
Expand Down Expand Up @@ -1620,6 +1624,9 @@ func setMiner(ctx *cli.Context, cfg *miner.Config) {
if ctx.GlobalIsSet(MinerMaxAccountsNumFlag.Name) {
cfg.MaxAccountsNum = ctx.GlobalInt(MinerMaxAccountsNumFlag.Name)
}
if ctx.GlobalIsSet(MinerAllowEmptyFlag.Name) {
cfg.AllowEmpty = ctx.GlobalBool(MinerAllowEmptyFlag.Name)
}
if ctx.GlobalIsSet(LegacyMinerGasTargetFlag.Name) {
log.Warn("The generic --miner.gastarget flag is deprecated and will be removed in the future!")
}
Expand Down
1 change: 1 addition & 0 deletions miner/miner.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ type Config struct {
StoreSkippedTxTraces bool // Whether store the wrapped traces when storing a skipped tx
MaxAccountsNum int // Maximum number of accounts that miner will fetch the pending transactions of when building a new block
CCCMaxWorkers int // Maximum number of workers to use for async CCC tasks
AllowEmpty bool // If true, then we allow sealing empty blocks

SigningDisabled bool // Whether to disable signing blocks with consensus enginek
}
Expand Down
3 changes: 3 additions & 0 deletions miner/scroll_worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,9 @@ func (w *worker) mainLoop() {
w.current.deadlineReached = true
if len(w.current.txs) > 0 {
_, err = w.commit()
} else if w.config.AllowEmpty {
log.Warn("Committing empty block", "number", w.current.header.Number)
_, err = w.commit()
}
case ev := <-w.txsCh:
idleTimer.UpdateSince(idleStart)
Expand Down
2 changes: 1 addition & 1 deletion params/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
const (
VersionMajor = 5 // Major version component of the current release
VersionMinor = 8 // Minor version component of the current release
VersionPatch = 28 // Patch version component of the current release
VersionPatch = 29 // Patch version component of the current release
VersionMeta = "mainnet" // Version metadata to append to the version string
)

Expand Down
Loading