MCPcopy Create free account
hub / github.com/ethstorage/es-node / computeHash

Method computeHash

ethstorage/miner/worker.go:709–719  ·  view source on GitHub ↗

computeHash calculates final hash from hash0

(shardIdx uint64, hash0 common.Hash)

Source from the content-addressed store, hash-verified

707
708// computeHash calculates final hash from hash0
709func (w *worker) computeHash(shardIdx uint64, hash0 common.Hash) (common.Hash, []uint64, error) {
710 return hashimoto(
711 w.storageMgr.KvEntriesBits(),
712 w.storageMgr.MaxKvSizeBits(),
713 es.SampleSizeBits,
714 shardIdx,
715 w.config.RandomChecks,
716 w.dataReader.ReadSample,
717 hash0,
718 )
719}
720
721// getMiningData retrieves data needed to generate proof and verify against the contract.
722func (w *worker) getMiningData(t *task, sampleIdx []uint64) ([][]byte, []uint64, []uint64, []common.Hash, []common.Hash, error) {

Callers 1

mineTaskMethod · 0.95

Calls 3

hashimotoFunction · 0.70
KvEntriesBitsMethod · 0.45
MaxKvSizeBitsMethod · 0.45

Tested by

no test coverage detected