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: select active sets that were received 2 hours before start #5289

Closed
wants to merge 1 commit into from
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,10 @@ type BaseConfig struct {
MinerGoodAtxsPercent int `mapstructure:"miner-good-atxs-percent"`

RegossipAtxInterval time.Duration `mapstructure:"regossip-atx-interval"`

// ATXGradeDelay is used to grade ATXs for selection in tortoise active set.
// See grading fuction in miner/proposals_builder.go
ATXGradeDelay time.Duration `mapstructure:"atx-grade-delay"`
}

type PublicMetrics struct {
Expand Down Expand Up @@ -201,6 +205,7 @@ func defaultBaseConfig() BaseConfig {
DatabaseSizeMeteringInterval: 10 * time.Minute,
DatabasePruneInterval: 30 * time.Minute,
NetworkHRP: "sm",
ATXGradeDelay: 10 * time.Second,
}
}

Expand Down
1 change: 1 addition & 0 deletions config/mainnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ func MainnetConfig() Config {
"https://poet-112.spacemesh.network",
},
RegossipAtxInterval: 2 * time.Hour,
ATXGradeDelay: 30 * time.Minute,
},
Genesis: &GenesisConfig{
GenesisTime: "2023-07-14T08:00:00Z",
Expand Down
1 change: 1 addition & 0 deletions config/presets/testnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ func testnet() config.Config {
TickSize: 666514,
PoETServers: []string{},
RegossipAtxInterval: time.Hour,
ATXGradeDelay: 30 * time.Minute,
},
Genesis: &config.GenesisConfig{
GenesisTime: "2023-09-13T18:00:00Z",
Expand Down
3 changes: 1 addition & 2 deletions node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -861,8 +861,7 @@ func (app *App) initServices(ctx context.Context) error {
miner.WithLayerPerEpoch(layersPerEpoch),
miner.WithMinimalActiveSetWeight(app.Config.Tortoise.MinimalActiveSetWeight),
miner.WithHdist(app.Config.Tortoise.Hdist),
// TODO(dshulyak) ???
miner.WithNetworkDelay(app.Config.HARE3.PreroundDelay),
miner.WithNetworkDelay(app.Config.ATXGradeDelay),
miner.WithMinGoodAtxPercent(minerGoodAtxPct),
miner.WithLogger(app.addLogger(ProposalBuilderLogger, lg)),
)
Expand Down