From a69b898a230509ecfa7d5d0196c63db41bd05f9f Mon Sep 17 00:00:00 2001 From: rjl493456442 Date: Wed, 3 Mar 2021 15:53:56 +0800 Subject: [PATCH 1/2] cmd/utils: fix exclusive check for archive node --- cmd/utils/flags.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index 324a6d6a4729..4ae55f4a1aaf 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -1477,8 +1477,10 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) { CheckExclusive(ctx, MainnetFlag, DeveloperFlag, RopstenFlag, RinkebyFlag, GoerliFlag, YoloV3Flag) CheckExclusive(ctx, LightServeFlag, SyncModeFlag, "light") CheckExclusive(ctx, DeveloperFlag, ExternalSignerFlag) // Can't use both ephemeral unlocked and external signer - CheckExclusive(ctx, GCModeFlag, "archive", TxLookupLimitFlag) - if ctx.GlobalIsSet(LightServeFlag.Name) && ctx.GlobalIsSet(TxLookupLimitFlag.Name) { + if ctx.GlobalString(GCModeFlag.Name) == "archive" && ctx.GlobalUint64(TxLookupLimitFlag.Name) != 0 { + Fatalf("Transaction unindexing is incompatible with archive node, please set `--txlookuplimit = 0`") + } + if ctx.GlobalIsSet(LightServeFlag.Name) && ctx.GlobalUint64(TxLookupLimitFlag.Name) != 0 { log.Warn("LES server cannot serve old transaction status and cannot connect below les/4 protocol version if transaction lookup index is limited") } var ks *keystore.KeyStore From 53092c79efd83aeca921d2a46fb4901ec46f2a46 Mon Sep 17 00:00:00 2001 From: rjl493456442 Date: Wed, 3 Mar 2021 16:03:10 +0800 Subject: [PATCH 2/2] cmd/utils: set the txlookuplimit to 0 --- cmd/utils/flags.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index 4ae55f4a1aaf..7bbca4265414 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -1478,7 +1478,8 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) { CheckExclusive(ctx, LightServeFlag, SyncModeFlag, "light") CheckExclusive(ctx, DeveloperFlag, ExternalSignerFlag) // Can't use both ephemeral unlocked and external signer if ctx.GlobalString(GCModeFlag.Name) == "archive" && ctx.GlobalUint64(TxLookupLimitFlag.Name) != 0 { - Fatalf("Transaction unindexing is incompatible with archive node, please set `--txlookuplimit = 0`") + ctx.GlobalSet(TxLookupLimitFlag.Name, "0") + log.Warn("Disable transaction unindexing for archive node") } if ctx.GlobalIsSet(LightServeFlag.Name) && ctx.GlobalUint64(TxLookupLimitFlag.Name) != 0 { log.Warn("LES server cannot serve old transaction status and cannot connect below les/4 protocol version if transaction lookup index is limited")