From 820316f8a4dedbdc1e5719e931373ff33dcf2c23 Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Tue, 3 Jun 2025 10:55:57 +0200 Subject: [PATCH 1/2] cmd/geth: fix era1 download location to match store This changes the era1 downloader to place the files into the correct location where geth will actually use them. Also adds integration with the new --datadir.era flag. --- cmd/geth/chaincmd.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cmd/geth/chaincmd.go b/cmd/geth/chaincmd.go index d8488b826822..9be37c5a25bb 100644 --- a/cmd/geth/chaincmd.go +++ b/cmd/geth/chaincmd.go @@ -723,8 +723,12 @@ func downloadEra(ctx *cli.Context) error { // Resolve the destination directory. stack, _ := makeConfigNode(ctx) defer stack.Close() - ancients := stack.ResolveAncient("chaindata", "") + + ancients := stack.ResolveAncient("chaindata", "chain") dir := filepath.Join(ancients, "era") + if ctx.IsSet(utils.EraFlag.Name) { + dir = filepath.Join(ancients, ctx.String(utils.EraFlag.Name)) + } baseURL := ctx.String(eraServerFlag.Name) if baseURL == "" { From e3f6263bfd70559efa48d67f1c0e0ab2cc294918 Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Thu, 5 Jun 2025 16:14:32 +0200 Subject: [PATCH 2/2] cmd/geth: fix era path --- cmd/geth/chaincmd.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/geth/chaincmd.go b/cmd/geth/chaincmd.go index 9be37c5a25bb..e0606f0d0bc9 100644 --- a/cmd/geth/chaincmd.go +++ b/cmd/geth/chaincmd.go @@ -724,8 +724,8 @@ func downloadEra(ctx *cli.Context) error { stack, _ := makeConfigNode(ctx) defer stack.Close() - ancients := stack.ResolveAncient("chaindata", "chain") - dir := filepath.Join(ancients, "era") + ancients := stack.ResolveAncient("chaindata", "") + dir := filepath.Join(ancients, rawdb.ChainFreezerName, "era") if ctx.IsSet(utils.EraFlag.Name) { dir = filepath.Join(ancients, ctx.String(utils.EraFlag.Name)) }