lambdaclass / ethereum_rust

Lambda Ethereum Rust Execution client
Apache License 2.0
116 stars 7 forks source link

Default to db store Engine when no `datadir` is specified #395

Open mpaulucci opened 2 weeks ago

mpaulucci commented 2 weeks ago

Currently, we default to EngineType::InMemory, but we should default to EngineType::Libmdbx with a default data directory.

What would be the appropriate default directory?

Geth seems to default to

    --datadir value                     (default: /root/.ethereum)         ($GETH_DATADIR)
          Data directory for the databases and keystore

Reth defaults to

Datadir:
      --datadir <DATA_DIR>
          The path to the data dir for all reth files and subdirectories.

          Defaults to the OS-specific data directory:

          - Linux: `$XDG_DATA_HOME/reth/` or `$HOME/.local/share/reth/`
          - Windows: `{FOLDERID_RoamingAppData}/reth/`
          - macOS: `$HOME/Library/Application Support/reth/`

          [default: default]
Oppen commented 1 week ago

There is a crate named dirs which resolves the different kind of directories we may care about to the appropriate standard location of the host OS (which is what reth does). I think it would be reasonable to use it.