Defaults.Ethash init¶
| Source (upstream pre-purge) | Current | |
|---|---|---|
| File | eth/ethconfig/config.go |
config_pow.go |
| Symbol | init |
init |
| Ref | dde2da0ef~1 |
etc/v1.17.3-full-node |
Restores ethash defaults (CacheDir, CachesInMem, DatasetsOnDisk, etc.) and platform-specific DatasetDir paths removed in purge3. Moved to config_pow.go to keep config.go identical to upstream.
3-way merge — purge → getc ← upstream¶
pre-purgefork-only
↗func init() {
// Set ethash defaults (removed in upstream after PoW deprecation).
Defaults.Ethash = ethash.Config{
CacheDir: "ethash",
CachesInMem: 2,
CachesOnDisk: 3,
CachesLockMmap: false,
DatasetsInMem: 1,
DatasetsOnDisk: 2,
DatasetsLockMmap: false,
}
// Set platform-specific DAG directory.
↗ home := os.Getenv("HOME")
if home == "" {
if user, err := user.Current(); err == nil {
home = user.HomeDir
}
}
if runtime.GOOS == "darwin" {
Defaults.Ethash.DatasetDir = filepath.Join(home, "Library", "Ethash")
} else if runtime.GOOS == "windows" {
localappdata := os.Getenv("LOCALAPPDATA")
if localappdata != "" {
Defaults.Ethash.DatasetDir = filepath.Join(localappdata, "Ethash")
} else {
Defaults.Ethash.DatasetDir = filepath.Join(home, "AppData", "Local", "Ethash")
}
} else {
Defaults.Ethash.DatasetDir = filepath.Join(home, ".ethash")
}
}
core-geth validation — +12 -0
| | | |---|---| | File | [`config.go`](https://github.com/etclabscore/core-geth/blob/v1.12.20/eth/ethconfig/config.go) | | Symbol | `init` | | Ref | `v1.12.20` |--- a/core-geth/eth/ethconfig/config.go
+++ b/etc/eth/ethconfig/config_pow.go
@@ -1,4 +1,16 @@
func init() {
+ // Set ethash defaults (removed in upstream after PoW deprecation).
+ Defaults.Ethash = ethash.Config{
+ CacheDir: "ethash",
+ CachesInMem: 2,
+ CachesOnDisk: 3,
+ CachesLockMmap: false,
+ DatasetsInMem: 1,
+ DatasetsOnDisk: 2,
+ DatasetsLockMmap: false,
+ }
+
+ // Set platform-specific DAG directory.
home := os.Getenv("HOME")
if home == "" {
if user, err := user.Current(); err == nil {