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

Improve rate-setter UX #2315

Merged
merged 2 commits into from
Jul 7, 2022
Merged
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
6 changes: 3 additions & 3 deletions packages/tangle/ratesetter.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const (
// Wmax is the maximum inbox threshold for the node. This value denotes when maximum active mana holder backs off its rate.
Wmax = 10
// Wmin is the min inbox threshold for the node. This value denotes when nodes with the least mana back off their rate.
Wmin = 2
Wmin = 5
)

var (
Expand Down Expand Up @@ -176,7 +176,7 @@ func (r *RateSetter) rateSetting() {
ownRate /= RateSettingDecrease
r.pauseUpdates = r.initialPauseUpdates
} else {
ownRate += RateSettingIncrease * ownMana / totalMana
ownRate += math.Max(RateSettingIncrease*ownMana/totalMana, 0.01)
}
r.ownRate.Store(math.Min(r.maxRate, ownRate))
}
Expand Down Expand Up @@ -250,7 +250,7 @@ func (r *RateSetter) initializeInitialRate() {
} else {
ownMana := math.Max(r.tangle.Options.SchedulerParams.AccessManaMapRetrieverFunc()[r.tangle.Options.Identity.ID()], MinMana)
totalMana := r.tangle.Options.SchedulerParams.TotalAccessManaRetrieveFunc()
r.ownRate.Store(math.Max(ownMana/totalMana*r.maxRate, 0.001))
r.ownRate.Store(math.Max(ownMana/totalMana*r.maxRate, 1))
}
}

Expand Down
2 changes: 1 addition & 1 deletion plugins/manainitializer/parameters.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
// ParametersDefinition contains the definition of the parameters used by the manainitializer plugin.
type ParametersDefinition struct {
// FaucetAPI defines API address of the faucet node.
FaucetAPI string `default:"faucet-01.devnet.shimmer.iota.cafe:8080" usage:"API address of the faucet node"`
FaucetAPI string `default:"http://faucet-01.devnet.shimmer.iota.cafe:8080" usage:"API address of the faucet node"`
// Address defines address to request the funds for. By default, the address of the node is used.
Address string `usage:"address to request the funds for. By default, the address of the node is used"`
}
Expand Down
2 changes: 1 addition & 1 deletion plugins/messagelayer/parameters.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ type RateSetterParametersDefinition struct {
// Initial defines the initial rate of rate setting.
Initial float64 `default:"0" usage:"the initial rate of rate setting. Set 0 to automatically estimate the value based on access mana."`
// RateSettingPause defines for how long to pause updates after decrease of rate.
RateSettingPause time.Duration `default:"2s" usage:"for how long to pause updates after decrease of rate"`
RateSettingPause time.Duration `default:"1s" usage:"for how long to pause updates after decrease of rate"`
// Enable is the flag that enables the rate setting mechanism on node startup.
Enable bool `default:"true" usage:"whether to enable rate setter"`
}
Expand Down