Skip to content

Commit

Permalink
Default (nonces, threads) = (288, CPU*3/4) for Mainnet
Browse files Browse the repository at this point in the history
  • Loading branch information
poszu committed Jul 22, 2023
1 parent 0bd65e1 commit 45b5fbe
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion config/mainnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"math/big"
"os"
"path/filepath"
"runtime"
"time"

"github.com/spacemeshos/go-spacemesh/activation"
Expand All @@ -27,6 +28,14 @@ func MainnetConfig() Config {
panic(err)
}
p2pconfig := p2p.DefaultConfig()

smeshing := DefaultSmeshingConfig()
smeshing.ProvingOpts.Nonces = 288
smeshing.ProvingOpts.Threads = uint(runtime.NumCPU() * 3 / 4)
if smeshing.ProvingOpts.Threads < 1 {
smeshing.ProvingOpts.Threads = 1
}

Check warning on line 37 in config/mainnet.go

View check run for this annotation

Codecov / codecov/patch

config/mainnet.go#L36-L37

Added lines #L36 - L37 were not covered by tests

return Config{
BaseConfig: BaseConfig{
DataDirParent: defaultDataDir,
Expand Down Expand Up @@ -115,7 +124,7 @@ func MainnetConfig() Config {
P2P: p2pconfig,
API: grpcserver.DefaultConfig(),
TIME: timeConfig.DefaultConfig(),
SMESHING: DefaultSmeshingConfig(),
SMESHING: smeshing,
FETCH: fetch.DefaultConfig(),
LOGGING: defaultLoggingConfig(),
Sync: syncer.DefaultConfig(),
Expand Down

0 comments on commit 45b5fbe

Please sign in to comment.