Skip to content

Commit

Permalink
Upgrade Epochs and Periods to Mainnet parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
Djadih committed Dec 4, 2024
1 parent d260058 commit e4edd17
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
27 changes: 15 additions & 12 deletions consensus/progpow/algorithm.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ package progpow
import (
"encoding/binary"
"hash"
"math"
"math/big"
"reflect"
"runtime"
Expand All @@ -35,20 +34,24 @@ import (
"github.com/dominant-strategies/go-quai/common/bitutil"
"github.com/dominant-strategies/go-quai/crypto"
"github.com/dominant-strategies/go-quai/log"
"github.com/dominant-strategies/go-quai/params"
)

const (
datasetInitBytes = 1 << 32 // Bytes in dataset at genesis
datasetGrowthBytes = 1 << 26 // Dataset growth per epoch
cacheInitBytes = 1 << 24 // Bytes in cache at genesis
cacheGrowthBytes = 1 << 21 // Cache growth per epoch
C_epochLength = math.MaxUint64 // Blocks per epoch
mixBytes = 128 // Width of mix
hashBytes = 64 // Hash length in bytes
hashWords = 16 // Number of 32 bit ints in a hash
datasetParents = 512 // Number of parents of each dataset element
cacheRounds = 3 // Number of rounds in cache production
loopAccesses = 64 // Number of accesses in hashimoto loop
datasetInitBytes = 1 << 32 // Bytes in dataset at genesis
datasetGrowthBytes = 1 << 26 // Dataset growth per epoch
cacheInitBytes = 1 << 24 // Bytes in cache at genesis
cacheGrowthBytes = 1 << 21 // Cache growth per epoch
mixBytes = 128 // Width of mix
hashBytes = 64 // Hash length in bytes
hashWords = 16 // Number of 32 bit ints in a hash
datasetParents = 512 // Number of parents of each dataset element
cacheRounds = 3 // Number of rounds in cache production
loopAccesses = 64 // Number of accesses in hashimoto loop
)

var (
C_epochLength = params.BlocksPerDay * 30 / 4 // 30 days worth of prime blocks
)

// cacheSize returns the size of the ethash verification cache that belongs to a certain
Expand Down
3 changes: 1 addition & 2 deletions consensus/progpow/algorithm_progpow.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ package progpow

import (
"encoding/binary"
"math"
"math/bits"

goLRU "github.com/hashicorp/golang-lru/v2"
Expand All @@ -33,7 +32,7 @@ const (
progpowDagLoads = 4 // Number of uint32 loads from the DAG per lane
progpowCntCache = 11
progpowCntMath = 18
progpowPeriodLength = math.MaxUint64
progpowPeriodLength = 10
progpowCntDag = 64
progpowMixBytes = 256
)
Expand Down

0 comments on commit e4edd17

Please sign in to comment.