mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
cmd, miner: revert noadvance flag
The reason for this is: if the transaction execution is even longer than block time, then this kind of transactions is DoS attack.
This commit is contained in:
parent
9e9062b99a
commit
7233837a1c
5 changed files with 2 additions and 16 deletions
|
|
@ -121,7 +121,6 @@ var (
|
|||
utils.MinerLegacyExtraDataFlag,
|
||||
utils.MinerRecommitIntervalFlag,
|
||||
utils.MinerNoVerfiyFlag,
|
||||
utils.MinerNoAdvanceFlag,
|
||||
utils.NATFlag,
|
||||
utils.NoDiscoverFlag,
|
||||
utils.DiscoveryV5Flag,
|
||||
|
|
|
|||
|
|
@ -203,7 +203,6 @@ var AppHelpFlagGroups = []flagGroup{
|
|||
utils.MinerExtraDataFlag,
|
||||
utils.MinerRecommitIntervalFlag,
|
||||
utils.MinerNoVerfiyFlag,
|
||||
utils.MinerNoAdvanceFlag,
|
||||
},
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -425,10 +425,6 @@ var (
|
|||
Name: "miner.noverify",
|
||||
Usage: "Disable remote sealing verification",
|
||||
}
|
||||
MinerNoAdvanceFlag = cli.BoolFlag{
|
||||
Name: "miner.noadvance",
|
||||
Usage: "Disable advance sealing on an empty block",
|
||||
}
|
||||
// Account settings
|
||||
UnlockedAccountFlag = cli.StringFlag{
|
||||
Name: "unlock",
|
||||
|
|
@ -1267,9 +1263,6 @@ func setMiner(ctx *cli.Context, cfg *miner.Config) {
|
|||
if ctx.GlobalIsSet(MinerNoVerfiyFlag.Name) {
|
||||
cfg.Noverify = ctx.Bool(MinerNoVerfiyFlag.Name)
|
||||
}
|
||||
if ctx.GlobalIsSet(MinerNoAdvanceFlag.Name) {
|
||||
cfg.NoAdvance = ctx.Bool(MinerNoAdvanceFlag.Name)
|
||||
}
|
||||
}
|
||||
|
||||
func setWhitelist(ctx *cli.Context, cfg *eth.Config) {
|
||||
|
|
|
|||
|
|
@ -51,7 +51,6 @@ type Config struct {
|
|||
GasPrice *big.Int // Minimum gas price for mining a transaction
|
||||
Recommit time.Duration // The time interval for miner to re-create mining work.
|
||||
Noverify bool // Disable remote mining solution verification(only useful in ethash).
|
||||
NoAdvance bool // Disable advance sealing on empty block.
|
||||
}
|
||||
|
||||
// Miner creates blocks and searches for proof-of-work values.
|
||||
|
|
|
|||
|
|
@ -214,7 +214,7 @@ func newWorker(config *Config, chainConfig *params.ChainConfig, engine consensus
|
|||
}
|
||||
|
||||
go worker.mainLoop()
|
||||
go worker.newWorkLoop(recommit, worker.config.NoAdvance)
|
||||
go worker.newWorkLoop(recommit)
|
||||
go worker.resultLoop()
|
||||
go worker.taskLoop()
|
||||
|
||||
|
|
@ -285,7 +285,7 @@ func (w *worker) close() {
|
|||
}
|
||||
|
||||
// newWorkLoop is a standalone goroutine to submit new mining work upon received events.
|
||||
func (w *worker) newWorkLoop(recommit time.Duration, noAdvance bool) {
|
||||
func (w *worker) newWorkLoop(recommit time.Duration) {
|
||||
var (
|
||||
interrupt *int32
|
||||
minRecommit = recommit // minimal resubmit interval specified by user.
|
||||
|
|
@ -300,10 +300,6 @@ func (w *worker) newWorkLoop(recommit time.Duration, noAdvance bool) {
|
|||
if interrupt != nil {
|
||||
atomic.StoreInt32(interrupt, s)
|
||||
}
|
||||
// Disable advance sealing explicitly if user require.
|
||||
if noAdvance {
|
||||
noempty = true
|
||||
}
|
||||
interrupt = new(int32)
|
||||
w.newWorkCh <- &newWorkReq{interrupt: interrupt, noempty: noempty, timestamp: timestamp}
|
||||
timer.Reset(recommit)
|
||||
|
|
|
|||
Loading…
Reference in a new issue