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] - Don't rewrite poet config #4782

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 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
3 changes: 3 additions & 0 deletions activation/poet.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ func withCustomHttpClient(client *http.Client) PoetClientOpts {

// NewHTTPPoetClient returns new instance of HTTPPoetClient connecting to the specified url.
func NewHTTPPoetClient(baseUrl string, cfg PoetConfig, opts ...PoetClientOpts) (*HTTPPoetClient, error) {
// TODO(brozansk): Take a logger and use it instead of global logger
fasmat marked this conversation as resolved.
Show resolved Hide resolved
log.With().Info("creating poet client", log.String("url", baseUrl), log.Int("max_retries", cfg.MaxRequestRetries), log.Stringer("retry_delay", cfg.RequestRetryDelay))

client := &retryablehttp.Client{
RetryMax: cfg.MaxRequestRetries,
RetryWaitMin: cfg.RequestRetryDelay,
Expand Down
11 changes: 3 additions & 8 deletions node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -634,11 +634,6 @@ func (app *App) initServices(ctx context.Context) error {
return fmt.Errorf("failed to create mesh: %w", err)
}

poetCfg := activation.PoetConfig{
PhaseShift: app.Config.POET.PhaseShift,
CycleGap: app.Config.POET.CycleGap,
GracePeriod: app.Config.POET.GracePeriod,
}
fetcherWrapped := &layerFetcher{}
atxHandler := activation.NewHandler(
app.cachedDB,
Expand All @@ -653,7 +648,7 @@ func (app *App) initServices(ctx context.Context) error {
beaconProtocol,
trtl,
app.addLogger(ATXHandlerLogger, lg),
poetCfg,
app.Config.POET,
)

// we can't have an epoch offset which is greater/equal than the number of layers in an epoch
Expand Down Expand Up @@ -802,7 +797,7 @@ func (app *App) initServices(ctx context.Context) error {
app.Config.SMESHING.Opts.DataDir,
app.addLogger(NipostBuilderLogger, lg),
app.edSgn,
poetCfg,
app.Config.POET,
app.clock,
activation.WithNipostValidator(app.validator),
)
Expand Down Expand Up @@ -839,7 +834,7 @@ func (app *App) initServices(ctx context.Context) error {
newSyncer,
app.addLogger("atxBuilder", lg),
activation.WithContext(ctx),
activation.WithPoetConfig(poetCfg),
activation.WithPoetConfig(app.Config.POET),
activation.WithPoetRetryInterval(app.Config.HARE.WakeupDelta),
activation.WithValidator(app.validator),
)
Expand Down