Skip to content

seedHash

Source (upstream pre-purge) Current
File consensus/ethash/algorithm.go algorithm.go
Symbol seedHash seedHash
Ref dde2da0ef~1 etc/v1.17.3-full-node

3-way merge — purge → getc ← upstream

pre-purgecore-geth
// seedHash is the seed to use for generating a verification cache and the mining
// dataset. The block number passed should be pre-rounded to an epoch boundary + 1
// e.g: seedHash(calcEpochBlock(epoch, epochLength))
func seedHash(epoch uint64, epochLength uint64) []byte {
block := calcEpochBlock(epoch, epochLength)
seed := make([]byte, 32)
if block < epochLengthDefault {
return seed
}
keccak256 := makeHasher(sha3.NewLegacyKeccak256())
for i := 0; i < int(block/epochLengthDefault); i++ {
keccak256(seed, seed)
}
return seed
}
core-geth validation — **Identical** ✅ | | | |---|---| | File | [`algorithm.go`](https://github.com/etclabscore/core-geth/blob/v1.12.20/consensus/ethash/algorithm.go) | | Symbol | `seedHash` | | Ref | `v1.12.20` |

← Consensus & Ethash