aboutsummaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorFelföldi Zsolt <zsfelfoldi@gmail.com>2017-04-06 22:20:42 +0800
committerPéter Szilágyi <peterke@gmail.com>2017-04-06 22:20:42 +0800
commit9aca9e6deb243b87cc75325be593a3b0c2f0a113 (patch)
tree605baeff7692446519b40118314a44a2fcb8e923 /cmd
parent0ec1104ba92c226c279389bbeb88ca515208f030 (diff)
downloadgo-tangerine-9aca9e6deb243b87cc75325be593a3b0c2f0a113.tar
go-tangerine-9aca9e6deb243b87cc75325be593a3b0c2f0a113.tar.gz
go-tangerine-9aca9e6deb243b87cc75325be593a3b0c2f0a113.tar.bz2
go-tangerine-9aca9e6deb243b87cc75325be593a3b0c2f0a113.tar.lz
go-tangerine-9aca9e6deb243b87cc75325be593a3b0c2f0a113.tar.xz
go-tangerine-9aca9e6deb243b87cc75325be593a3b0c2f0a113.tar.zst
go-tangerine-9aca9e6deb243b87cc75325be593a3b0c2f0a113.zip
cmd, les, eth, eth/gasprice: using new gas price oracle (#13853)
* cmd, les, eth, eth/gasprice: using new gas price oracle * eth/gasprice: renamed source file * eth/gasprice: added security checks for gpo params * eth/gasprice: fixed naming issues * eth/gasprice: max limit, maxEmpty
Diffstat (limited to 'cmd')
-rw-r--r--cmd/geth/main.go8
-rw-r--r--cmd/geth/usage.go8
-rw-r--r--cmd/utils/flags.go42
3 files changed, 13 insertions, 45 deletions
diff --git a/cmd/geth/main.go b/cmd/geth/main.go
index e942d53c8..c4309f44b 100644
--- a/cmd/geth/main.go
+++ b/cmd/geth/main.go
@@ -147,12 +147,8 @@ func init() {
utils.FakePoWFlag,
utils.NoCompactionFlag,
utils.SolcPathFlag,
- utils.GpoMinGasPriceFlag,
- utils.GpoMaxGasPriceFlag,
- utils.GpoFullBlockRatioFlag,
- utils.GpobaseStepDownFlag,
- utils.GpobaseStepUpFlag,
- utils.GpobaseCorrectionFactorFlag,
+ utils.GpoBlocksFlag,
+ utils.GpoPercentileFlag,
utils.ExtraDataFlag,
}
app.Flags = append(app.Flags, debug.Flags...)
diff --git a/cmd/geth/usage.go b/cmd/geth/usage.go
index 74768f507..491a4eb98 100644
--- a/cmd/geth/usage.go
+++ b/cmd/geth/usage.go
@@ -151,12 +151,8 @@ var AppHelpFlagGroups = []flagGroup{
{
Name: "GAS PRICE ORACLE",
Flags: []cli.Flag{
- utils.GpoMinGasPriceFlag,
- utils.GpoMaxGasPriceFlag,
- utils.GpoFullBlockRatioFlag,
- utils.GpobaseStepDownFlag,
- utils.GpobaseStepUpFlag,
- utils.GpobaseCorrectionFactorFlag,
+ utils.GpoBlocksFlag,
+ utils.GpoPercentileFlag,
},
},
{
diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go
index acdf5d5dc..0ca407a75 100644
--- a/cmd/utils/flags.go
+++ b/cmd/utils/flags.go
@@ -409,35 +409,15 @@ var (
}
// Gas price oracle settings
- GpoMinGasPriceFlag = BigFlag{
- Name: "gpomin",
- Usage: "Minimum suggested gas price",
- Value: big.NewInt(20 * params.Shannon),
- }
- GpoMaxGasPriceFlag = BigFlag{
- Name: "gpomax",
- Usage: "Maximum suggested gas price",
- Value: big.NewInt(500 * params.Shannon),
- }
- GpoFullBlockRatioFlag = cli.IntFlag{
- Name: "gpofull",
- Usage: "Full block threshold for gas price calculation (%)",
- Value: 80,
- }
- GpobaseStepDownFlag = cli.IntFlag{
- Name: "gpobasedown",
- Usage: "Suggested gas price base step down ratio (1/1000)",
+ GpoBlocksFlag = cli.IntFlag{
+ Name: "gpoblocks",
+ Usage: "Number of recent blocks to check for gas prices",
Value: 10,
}
- GpobaseStepUpFlag = cli.IntFlag{
- Name: "gpobaseup",
- Usage: "Suggested gas price base step up ratio (1/1000)",
- Value: 100,
- }
- GpobaseCorrectionFactorFlag = cli.IntFlag{
- Name: "gpobasecf",
- Usage: "Suggested gas price base correction factor (%)",
- Value: 110,
+ GpoPercentileFlag = cli.IntFlag{
+ Name: "gpopercentile",
+ Usage: "Suggested gas price is the given percentile of a set of recent transaction gas prices",
+ Value: 50,
}
)
@@ -798,12 +778,8 @@ func RegisterEthService(ctx *cli.Context, stack *node.Node, extra []byte) {
ExtraData: MakeMinerExtra(extra, ctx),
DocRoot: ctx.GlobalString(DocRootFlag.Name),
GasPrice: GlobalBig(ctx, GasPriceFlag.Name),
- GpoMinGasPrice: GlobalBig(ctx, GpoMinGasPriceFlag.Name),
- GpoMaxGasPrice: GlobalBig(ctx, GpoMaxGasPriceFlag.Name),
- GpoFullBlockRatio: ctx.GlobalInt(GpoFullBlockRatioFlag.Name),
- GpobaseStepDown: ctx.GlobalInt(GpobaseStepDownFlag.Name),
- GpobaseStepUp: ctx.GlobalInt(GpobaseStepUpFlag.Name),
- GpobaseCorrectionFactor: ctx.GlobalInt(GpobaseCorrectionFactorFlag.Name),
+ GpoBlocks: ctx.GlobalInt(GpoBlocksFlag.Name),
+ GpoPercentile: ctx.GlobalInt(GpoPercentileFlag.Name),
SolcPath: ctx.GlobalString(SolcPathFlag.Name),
EthashCacheDir: MakeEthashCacheDir(ctx),
EthashCachesInMem: ctx.GlobalInt(EthashCachesInMemoryFlag.Name),