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

refactor(renterd): remove hostBlockHeightLeeway and migrationSurchargeMultiplier #832

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
8 changes: 8 additions & 0 deletions .changeset/tasty-bobcats-admire.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
'renterd': minor
'@siafoundation/renterd-js': minor
'@siafoundation/renterd-react': minor
'@siafoundation/renterd-types': minor
---

The gouging settings no longer include hostBlockHeightLeeway or migrationSurchargeMultiplier.
1 change: 0 additions & 1 deletion apps/renterd-e2e/src/fixtures/configResetSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ export const configResetAllSettings = step(
await fillTextInputByName(page, 'minPriceTableValidityMinutes', '5')
await fillTextInputByName(page, 'minAccountExpiryDays', '1')
await fillTextInputByName(page, 'minMaxEphemeralAccountBalance', '1')
await fillTextInputByName(page, 'migrationSurchargeMultiplier', '1')

// redundancy
await fillTextInputByName(page, 'minShards', '1')
Expand Down
6 changes: 0 additions & 6 deletions apps/renterd/components/Config/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -215,12 +215,6 @@ export function Config() {
form={form}
fields={fields}
/>
<ConfigurationPanelSetting
autoVisibility
name="migrationSurchargeMultiplier"
form={form}
fields={fields}
/>
</PanelMenuSection>
<ConfigurationPanel
title="Hosts"
Expand Down
35 changes: 0 additions & 35 deletions apps/renterd/contexts/config/fields.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -649,41 +649,6 @@ export function getFields({
},
},
},
migrationSurchargeMultiplier: {
category: 'gouging',
type: 'number',
title: 'Migration surcharge multiplier',
units: '* download price',
placeholder: '10',
decimalsLimit: 1,
description: (
<>
Factor that gets applied on the max download price when trying to
download migration-critical sectors from a host that is price gouging.
For example, when migrating a low-health file, if the download is
failing but would potentially succeed with looser gouging settings, we
apply the migration surcharge multiplier to overpay on every sector
download if it means saving the file/migration.
</>
),
...(recommendations.migrationSurchargeMultiplier
? {
suggestionLabel: 'Match with more hosts',
suggestion:
recommendations.migrationSurchargeMultiplier?.targetValue,
suggestionTip: 'This value will help you match with more hosts.',
}
: {
suggestion: new BigNumber(10),
suggestionTip: 'The default multiplier is 10x the download price.',
}),
hidden: configViewMode === 'basic',
validation: {
validate: {
required: requiredIfAdvanced(validationContext),
},
},
},

// Redundancy
minShards: {
Expand Down
4 changes: 0 additions & 4 deletions apps/renterd/contexts/config/transform.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ describe('tansforms', () => {
minAccountExpiryDays: new BigNumber(1),
minMaxEphemeralAccountBalance: new BigNumber('1'),
minPriceTableValidityMinutes: new BigNumber(5),
migrationSurchargeMultiplier: new BigNumber(10),
minShards: new BigNumber(10),
totalShards: new BigNumber(30),
maxStoragePriceTBMonthPinned: new BigNumber('5'),
Expand Down Expand Up @@ -248,7 +247,6 @@ describe('tansforms', () => {
minPriceTableValidityMinutes: new BigNumber(5),
minShards: new BigNumber(10),
totalShards: new BigNumber(30),
migrationSurchargeMultiplier: new BigNumber(10),
maxStoragePriceTBMonthPinned: new BigNumber('0'),
maxDownloadPriceTBPinned: new BigNumber('0'),
maxUploadPriceTBPinned: new BigNumber('0'),
Expand All @@ -275,7 +273,6 @@ describe('tansforms', () => {
minAccountExpiry: 86400000000000,
minMaxEphemeralAccountBalance: '1000000000000000000000000',
minPriceTableValidity: 300000000000,
migrationSurchargeMultiplier: 10,
})
})
})
Expand Down Expand Up @@ -509,7 +506,6 @@ function buildAllResponses() {
minAccountExpiry: 86400000000000,
minMaxEphemeralAccountBalance: '1000000000000000000000000',
minPriceTableValidity: 300000000000,
migrationSurchargeMultiplier: 10,
} as SettingsGouging,
pinned: {
currency: 'usd' as CurrencyId,
Expand Down
3 changes: 0 additions & 3 deletions apps/renterd/contexts/config/transformDown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,6 @@ export function transformDownGouging({
gouging.minMaxEphemeralAccountBalance,
scDecimalPlaces
),
migrationSurchargeMultiplier: new BigNumber(
gouging.migrationSurchargeMultiplier
),
}
}

Expand Down
1 change: 0 additions & 1 deletion apps/renterd/contexts/config/transformUp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ export function transformUpGouging(
minMaxEphemeralAccountBalance: toHastings(
v.minMaxEphemeralAccountBalance
).toString(),
migrationSurchargeMultiplier: v.migrationSurchargeMultiplier.toNumber(),
}
}

Expand Down
1 change: 0 additions & 1 deletion apps/renterd/contexts/config/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ export const inputValuesGouging = {
minPriceTableValidityMinutes: undefined as BigNumber | undefined,
minAccountExpiryDays: undefined as BigNumber | undefined,
minMaxEphemeralAccountBalance: undefined as BigNumber | undefined,
migrationSurchargeMultiplier: undefined as BigNumber | undefined,
}

export const inputValuesPinned = {
Expand Down
3 changes: 0 additions & 3 deletions apps/renterd/contexts/config/useAutopilotEvaluations.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,6 @@ const fieldToHrefId: Record<keyof RecommendableFields, string> = {
minPriceTableValidityMinutes: 'minPriceTableValidityMinutes',
minAccountExpiryDays: 'minAccountExpiryDays',
minMaxEphemeralAccountBalance: 'minMaxEphemeralAccountBalance',
migrationSurchargeMultiplier: 'migrationSurchargeMultiplier',
}

const fieldToLabel: Record<keyof RecommendableFields, string> = {
Expand All @@ -438,7 +437,6 @@ const fieldToLabel: Record<keyof RecommendableFields, string> = {
minPriceTableValidityMinutes: 'min price table validity',
minAccountExpiryDays: 'min account expiry',
minMaxEphemeralAccountBalance: 'min max ephemeral account balance',
migrationSurchargeMultiplier: 'migration surcharge multiplier',
}

export const valuesZeroDefaults: Values = {
Expand Down Expand Up @@ -468,7 +466,6 @@ export const valuesZeroDefaults: Values = {
minPriceTableValidityMinutes: new BigNumber(0),
minAccountExpiryDays: new BigNumber(0),
minMaxEphemeralAccountBalance: new BigNumber(0),
migrationSurchargeMultiplier: new BigNumber(0),
minShards: new BigNumber(0),
totalShards: new BigNumber(0),
pinnedCurrency: 'usd',
Expand Down
1 change: 0 additions & 1 deletion libs/renterd-types/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ export type SettingsGouging = {
minPriceTableValidity: number
minAccountExpiry: number
minMaxEphemeralAccountBalance: string
migrationSurchargeMultiplier: number
}

export type SettingsUploadPacking = {
Expand Down
Loading