Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Merged by Bors] - miner: parametrize threshold for picking active set from first block #4945

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 5 additions & 2 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,7 @@ func (cfg *Config) DataDir() string {
}

type TestConfig struct {
SmesherKey string `mapstructure:"testing-smesher-key"`
MinerGoodAtxPct int
SmesherKey string `mapstructure:"testing-smesher-key"`
}

// BaseConfig defines the default configuration options for spacemesh app.
Expand Down Expand Up @@ -114,6 +113,10 @@ type BaseConfig struct {
DatabaseLatencyMetering bool `mapstructure:"db-latency-metering"`

NetworkHRP string `mapstructure:"network-hrp"`

// MinerGoodAtxsPercent is a threshold to decide if tortoise activeset should be
// picked from first block insted of synced data.
MinerGoodAtxsPercent int `mapstructure:"miner-good-atxs-percent"`
}

type PublicMetrics struct {
Expand Down
3 changes: 2 additions & 1 deletion config/presets/fastnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ func fastnet() config.Config {
types.SetNetworkHRP(conf.NetworkHRP) // set to generate coinbase
conf.BaseConfig.OptFilterThreshold = 90

conf.BaseConfig.TestConfig.MinerGoodAtxPct = 50
// set for systest TestEquivocation
conf.BaseConfig.MinerGoodAtxsPercent = 50

conf.HARE.Disable = 1 // non-zero low layer will prevent hare1 from running
conf.HARE.N = 800
Expand Down
5 changes: 2 additions & 3 deletions node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -790,9 +790,8 @@
}

minerGoodAtxPct := 90
if app.Config.TestConfig.MinerGoodAtxPct > 0 {
// only set this for systest TestEquivocation.
minerGoodAtxPct = app.Config.TestConfig.MinerGoodAtxPct
if app.Config.MinerGoodAtxsPercent > 0 {
minerGoodAtxPct = app.Config.MinerGoodAtxsPercent

Check warning on line 794 in node/node.go

View check run for this annotation

Codecov / codecov/patch

node/node.go#L794

Added line #L794 was not covered by tests
}
proposalBuilder := miner.NewProposalBuilder(
ctx,
Expand Down