Skip to content

Commit

Permalink
miner: select active sets that were received 2 hours before start (#5289
Browse files Browse the repository at this point in the history
)

related: #5282

this should reduce variability in encoded active sets.
previous grader was using hare preround delay, which is 25s and not sufficient for atx to propagate across the network.
  • Loading branch information
dshulyak committed Nov 22, 2023
1 parent a553f80 commit 51b425e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
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 @@ -860,8 +860,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

0 comments on commit 51b425e

Please sign in to comment.