aboutsummaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2017-07-28 21:09:39 +0800
committerGitHub <noreply@github.com>2017-07-28 21:09:39 +0800
commit3d32690b54539d13ec8e7884bf3416ada6046354 (patch)
treee3d1f6abae6dd3336f02799934a2e5879500195c /cmd
parenta602ee90f2c28eadbca8cdc2e143825a4c24ab23 (diff)
downloaddexon-3d32690b54539d13ec8e7884bf3416ada6046354.tar.gz
dexon-3d32690b54539d13ec8e7884bf3416ada6046354.tar.zst
dexon-3d32690b54539d13ec8e7884bf3416ada6046354.zip
cmd, core, eth: journal local transactions to disk (#14784)
* core: reduce txpool event loop goroutines and sync structs * cmd, core, eth: journal local transactions to disk * core: journal replacement pending transactions too * core: separate transaction journal from pool
Diffstat (limited to 'cmd')
-rw-r--r--cmd/geth/main.go2
-rw-r--r--cmd/geth/usage.go2
-rw-r--r--cmd/utils/flags.go16
3 files changed, 20 insertions, 0 deletions
diff --git a/cmd/geth/main.go b/cmd/geth/main.go
index 607414bbb..e89f88ec9 100644
--- a/cmd/geth/main.go
+++ b/cmd/geth/main.go
@@ -67,6 +67,8 @@ var (
utils.EthashDatasetsInMemoryFlag,
utils.EthashDatasetsOnDiskFlag,
utils.TxPoolNoLocalsFlag,
+ utils.TxPoolJournalFlag,
+ utils.TxPoolRejournalFlag,
utils.TxPoolPriceLimitFlag,
utils.TxPoolPriceBumpFlag,
utils.TxPoolAccountSlotsFlag,
diff --git a/cmd/geth/usage.go b/cmd/geth/usage.go
index 275aad674..80861d852 100644
--- a/cmd/geth/usage.go
+++ b/cmd/geth/usage.go
@@ -96,6 +96,8 @@ var AppHelpFlagGroups = []flagGroup{
Name: "TRANSACTION POOL",
Flags: []cli.Flag{
utils.TxPoolNoLocalsFlag,
+ utils.TxPoolJournalFlag,
+ utils.TxPoolRejournalFlag,
utils.TxPoolPriceLimitFlag,
utils.TxPoolPriceBumpFlag,
utils.TxPoolAccountSlotsFlag,
diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go
index 0159364af..9f7b76c12 100644
--- a/cmd/utils/flags.go
+++ b/cmd/utils/flags.go
@@ -213,6 +213,16 @@ var (
Name: "txpool.nolocals",
Usage: "Disables price exemptions for locally submitted transactions",
}
+ TxPoolJournalFlag = cli.StringFlag{
+ Name: "txpool.journal",
+ Usage: "Disk journal for local transaction to survive node restarts",
+ Value: core.DefaultTxPoolConfig.Journal,
+ }
+ TxPoolRejournalFlag = cli.DurationFlag{
+ Name: "txpool.rejournal",
+ Usage: "Time interval to regenerate the local transaction journal",
+ Value: core.DefaultTxPoolConfig.Rejournal,
+ }
TxPoolPriceLimitFlag = cli.Uint64Flag{
Name: "txpool.pricelimit",
Usage: "Minimum gas price limit to enforce for acceptance into the pool",
@@ -838,6 +848,12 @@ func setTxPool(ctx *cli.Context, cfg *core.TxPoolConfig) {
if ctx.GlobalIsSet(TxPoolNoLocalsFlag.Name) {
cfg.NoLocals = ctx.GlobalBool(TxPoolNoLocalsFlag.Name)
}
+ if ctx.GlobalIsSet(TxPoolJournalFlag.Name) {
+ cfg.Journal = ctx.GlobalString(TxPoolJournalFlag.Name)
+ }
+ if ctx.GlobalIsSet(TxPoolRejournalFlag.Name) {
+ cfg.Rejournal = ctx.GlobalDuration(TxPoolRejournalFlag.Name)
+ }
if ctx.GlobalIsSet(TxPoolPriceLimitFlag.Name) {
cfg.PriceLimit = ctx.GlobalUint64(TxPoolPriceLimitFlag.Name)
}