From fa6528088d5ba4a234b8e2c74efb223af7aa3b25 Mon Sep 17 00:00:00 2001 From: Piotr Macek Date: Tue, 5 Jul 2022 19:36:23 +0200 Subject: [PATCH 1/2] Improve rate-setter UX --- packages/tangle/ratesetter.go | 2 +- plugins/manainitializer/parameters.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/tangle/ratesetter.go b/packages/tangle/ratesetter.go index d4a154db8e..c71754da0f 100644 --- a/packages/tangle/ratesetter.go +++ b/packages/tangle/ratesetter.go @@ -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)) } } diff --git a/plugins/manainitializer/parameters.go b/plugins/manainitializer/parameters.go index 5e3925a6ee..dcbf07f1fd 100644 --- a/plugins/manainitializer/parameters.go +++ b/plugins/manainitializer/parameters.go @@ -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"` } From 351ce2673161d5ceb7ccb680b72b727e958bc5bb Mon Sep 17 00:00:00 2001 From: Piotr Macek Date: Wed, 6 Jul 2022 12:55:28 +0200 Subject: [PATCH 2/2] Adjust more parameters. --- packages/tangle/ratesetter.go | 4 ++-- plugins/messagelayer/parameters.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/tangle/ratesetter.go b/packages/tangle/ratesetter.go index c71754da0f..39f4f82bde 100644 --- a/packages/tangle/ratesetter.go +++ b/packages/tangle/ratesetter.go @@ -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 ( @@ -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)) } diff --git a/plugins/messagelayer/parameters.go b/plugins/messagelayer/parameters.go index 849c1ca1f2..2b2458155c 100644 --- a/plugins/messagelayer/parameters.go +++ b/plugins/messagelayer/parameters.go @@ -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"` }