dag

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 10, 2021 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalcEpoch

func CalcEpoch(block uint64, epochLength uint64) uint64

calcEpoch returns the epoch for a given block number (ECIP-1099)

func DatasetSize

func DatasetSize(epoch uint64) uint64

datasetSize returns the size of the ethash mining dataset that belongs to a certain block number.

func GenerateDatasetItem1024

func GenerateDatasetItem1024(cache []uint32, index uint32, keccak512Hasher crypto.Hasher, datasetParents uint32) []uint32

func GenerateDatasetItem2048

func GenerateDatasetItem2048(cache []uint32, index uint32, keccak512Hasher crypto.Hasher, datasetParents uint32) []uint32

func GenerateDatasetItem512

func GenerateDatasetItem512(cache []uint32, index uint32, keccak512Hasher crypto.Hasher, datasetParents uint32) []uint32

Types

type LightDag

type LightDag struct {
	Name            string
	NumCaches       int // Maximum number of caches to keep before eviction (only init, don't modify)
	DatasetParents  uint32
	EpochLength     uint64
	SeedEpochLength uint64 // ETC uses 30000 for the seed epoch length but 60000 for the rest
	NeedsL1         bool
	// contains filtered or unexported fields
}

func (*LightDag) GetCache

func (dag *LightDag) GetCache(epoch uint64) *cache

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL