Skip to content

Commit

Permalink
Default (nonces, threads) = (288, CPU*3/4) for Mainnet (#4741)
Browse files Browse the repository at this point in the history
Co-authored-by: Matthias <5011972+fasmat@users.noreply.github.com>
  • Loading branch information
poszu and fasmat committed Jul 22, 2023
1 parent 0bd65e1 commit 1766164
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ jobs:
needs: filter-changes
if: ${{ needs.filter-changes.outputs.nondocchanges == 'true' }}
strategy:
fail-fast: false
fail-fast: true
matrix:
os:
- ubuntu-latest
Expand Down
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
}

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 1766164

Please sign in to comment.