From 14ba36cc1c70973bbc7062b9da5e4b5bfc93d5d2 Mon Sep 17 00:00:00 2001 From: Tristan Wilson Date: Thu, 11 Jul 2024 11:34:37 +0200 Subject: [PATCH] Move TxLookupLimit override into ParseNode Overriding it outside of ParseNode, which is called when reloading the config via LiveConfig, causes a mismatch in TxLookupLimit which is not hot reloadable. --- cmd/nitro/nitro.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/cmd/nitro/nitro.go b/cmd/nitro/nitro.go index 572e6d2f06..088cec01fa 100644 --- a/cmd/nitro/nitro.go +++ b/cmd/nitro/nitro.go @@ -369,11 +369,6 @@ func mainImpl() int { return 0 } - if nodeConfig.Execution.Caching.Archive && nodeConfig.Execution.TxLookupLimit != 0 { - log.Info("retaining ability to lookup full transaction history as archive mode is enabled") - nodeConfig.Execution.TxLookupLimit = 0 - } - if err := resourcemanager.Init(&nodeConfig.Node.ResourceMgmt); err != nil { flag.Usage() log.Crit("Failed to start resource management module", "err", err) @@ -914,6 +909,12 @@ func ParseNode(ctx context.Context, args []string) (*NodeConfig, *genericconf.Wa if nodeConfig.Execution.Caching.Archive { nodeConfig.Node.MessagePruner.Enable = false } + + if nodeConfig.Execution.Caching.Archive && nodeConfig.Execution.TxLookupLimit != 0 { + log.Info("retaining ability to lookup full transaction history as archive mode is enabled") + nodeConfig.Execution.TxLookupLimit = 0 + } + err = nodeConfig.Validate() if err != nil { return nil, nil, err