cmd: set name to chaindata for all the opened db (#31352)

When I'm running `geth import --metrics`, the metrics is different to
normal `geth --metrics`, so the grafana dashboard needs to be updated,
eg: `eth_db_chaindata_disk_read` vs `disk_read`.

So I think we should always set the name to `eth/db/chaindata` for more
convenient.

---------

Signed-off-by: jsvisa <delweng@gmail.com>
This commit is contained in:
Delweng 2025-03-18 21:32:29 +08:00 committed by sivaratrisrinivas
parent 6e01a0b44f
commit f81ad4fb67

View file

@ -2076,7 +2076,7 @@ func MakeChainDatabase(ctx *cli.Context, stack *node.Node, readonly bool) ethdb.
}
chainDb = remotedb.New(client)
default:
chainDb, err = stack.OpenDatabaseWithFreezer("chaindata", cache, handles, ctx.String(AncientFlag.Name), "", readonly)
chainDb, err = stack.OpenDatabaseWithFreezer("chaindata", cache, handles, ctx.String(AncientFlag.Name), "eth/db/chaindata/", readonly)
}
if err != nil {
Fatalf("Could not open database: %v", err)