From deb3e3d2730d89c64078c5b03af3a68f67dfd023 Mon Sep 17 00:00:00 2001 From: Alex Freska Date: Thu, 21 Nov 2024 09:49:50 -0500 Subject: [PATCH] refactor(renterd): remove allow redundant IPs setting --- .changeset/angry-dingos-stare.md | 8 ++++++++ .../src/fixtures/configResetSettings.ts | 1 - apps/renterd/contexts/config/fields.tsx | 17 ----------------- apps/renterd/contexts/config/transform.spec.ts | 9 --------- apps/renterd/contexts/config/transformDown.ts | 1 - apps/renterd/contexts/config/transformUp.ts | 1 - apps/renterd/contexts/config/types.ts | 3 --- .../contexts/config/useAutopilotEvaluations.tsx | 1 - libs/renterd-types/src/types.ts | 1 - 9 files changed, 8 insertions(+), 34 deletions(-) create mode 100644 .changeset/angry-dingos-stare.md diff --git a/.changeset/angry-dingos-stare.md b/.changeset/angry-dingos-stare.md new file mode 100644 index 000000000..1bb885c9a --- /dev/null +++ b/.changeset/angry-dingos-stare.md @@ -0,0 +1,8 @@ +--- +'renterd': minor +'@siafoundation/renterd-js': minor +'@siafoundation/renterd-react': minor +'@siafoundation/renterd-types': minor +--- + +Removed the allow redundant IPs setting. diff --git a/apps/renterd-e2e/src/fixtures/configResetSettings.ts b/apps/renterd-e2e/src/fixtures/configResetSettings.ts index 11f423c89..84d4c9f6e 100644 --- a/apps/renterd-e2e/src/fixtures/configResetSettings.ts +++ b/apps/renterd-e2e/src/fixtures/configResetSettings.ts @@ -30,7 +30,6 @@ export const configResetAllSettings = step( await setSwitchByLabel(page, 'prune', false) // hosts - await setSwitchByLabel(page, 'allowRedundantIPs', false) await fillTextInputByName(page, 'maxDowntimeHours', '330') await fillTextInputByName(page, 'maxConsecutiveScanFailures', '10') await fillTextInputByName(page, 'minProtocolVersion', '1.6.0') diff --git a/apps/renterd/contexts/config/fields.tsx b/apps/renterd/contexts/config/fields.tsx index 36328770d..a71054042 100644 --- a/apps/renterd/contexts/config/fields.tsx +++ b/apps/renterd/contexts/config/fields.tsx @@ -163,23 +163,6 @@ export function getFields({ }, // hosts - allowRedundantIPs: { - type: 'boolean', - category: 'hosts', - title: 'Redundant IPs', - description: ( - <> - Whether or not to allow forming contracts with multiple hosts in the - same IP subnet. The subnets used are /16 for IPv4, and /64 for IPv6. - - ), - suggestion: advancedDefaults?.allowRedundantIPs, - suggestionTip: `Defaults to ${ - advancedDefaults?.allowRedundantIPs ? 'on' : 'off' - }.`, - hidden: configViewMode === 'basic', - validation: {}, - }, maxDowntimeHours: { type: 'number', category: 'hosts', diff --git a/apps/renterd/contexts/config/transform.spec.ts b/apps/renterd/contexts/config/transform.spec.ts index d833e68da..2a2391aaf 100644 --- a/apps/renterd/contexts/config/transform.spec.ts +++ b/apps/renterd/contexts/config/transform.spec.ts @@ -50,7 +50,6 @@ describe('tansforms', () => { uploadTBMonth: new BigNumber('0.79'), storageTB: new BigNumber('1'), prune: true, - allowRedundantIPs: false, maxDowntimeHours: new BigNumber('1440'), maxConsecutiveScanFailures: new BigNumber('10'), minProtocolVersion: '', @@ -140,7 +139,6 @@ describe('tansforms', () => { uploadTBMonth: new BigNumber('0.785714285714285714285714285714'), storageTB: new BigNumber('1'), prune: true, - allowRedundantIPs: false, maxDowntimeHours: new BigNumber('1440'), maxConsecutiveScanFailures: new BigNumber('10'), minProtocolVersion: '', @@ -150,7 +148,6 @@ describe('tansforms', () => { ).toEqual({ enabled: true, hosts: { - allowRedundantIPs: false, maxDowntimeHours: 1440, maxConsecutiveScanFailures: 10, scoreOverrides: {}, @@ -181,7 +178,6 @@ describe('tansforms', () => { uploadTBMonth: new BigNumber('0.785714285714285714285714285714'), storageTB: new BigNumber('1'), prune: true, - allowRedundantIPs: false, maxDowntimeHours: new BigNumber('1440'), maxConsecutiveScanFailures: new BigNumber('10'), minProtocolVersion: '1.7.0', @@ -204,7 +200,6 @@ describe('tansforms', () => { enabled: false, hosts: { foobar: 'value', - allowRedundantIPs: false, maxDowntimeHours: 1440, maxConsecutiveScanFailures: 10, scoreOverrides: {}, @@ -236,7 +231,6 @@ describe('tansforms', () => { uploadTBMonth: new BigNumber('0.785714285714285714285714285714'), storageTB: new BigNumber('1'), prune: true, - allowRedundantIPs: false, maxDowntimeHours: new BigNumber('1440'), maxConsecutiveScanFailures: new BigNumber('10'), minProtocolVersion: '1.7.0', @@ -252,7 +246,6 @@ describe('tansforms', () => { ).toEqual({ enabled: true, hosts: { - allowRedundantIPs: false, maxDowntimeHours: 1440, maxConsecutiveScanFailures: 10, scoreOverrides: {}, @@ -285,7 +278,6 @@ describe('tansforms', () => { uploadTBMonth: new BigNumber('0.785714285714285714285714285714'), storageTB: new BigNumber('1'), prune: true, - allowRedundantIPs: false, maxDowntimeHours: new BigNumber('1440'), maxConsecutiveScanFailures: new BigNumber('10'), minProtocolVersion: '1.7.0', @@ -542,7 +534,6 @@ function buildAllResponses() { autopilot: { enabled: false, hosts: { - allowRedundantIPs: false, maxDowntimeHours: 1440, maxConsecutiveScanFailures: 10, scoreOverrides: {}, diff --git a/apps/renterd/contexts/config/transformDown.ts b/apps/renterd/contexts/config/transformDown.ts index ad12ef694..19fc1c8bd 100644 --- a/apps/renterd/contexts/config/transformDown.ts +++ b/apps/renterd/contexts/config/transformDown.ts @@ -71,7 +71,6 @@ export function transformDownAutopilot( storageTB, prune, // hosts - allowRedundantIPs: config.hosts.allowRedundantIPs, maxDowntimeHours: new BigNumber(config.hosts.maxDowntimeHours), maxConsecutiveScanFailures: new BigNumber( config.hosts.maxConsecutiveScanFailures diff --git a/apps/renterd/contexts/config/transformUp.ts b/apps/renterd/contexts/config/transformUp.ts index 11323de57..087d41e16 100644 --- a/apps/renterd/contexts/config/transformUp.ts +++ b/apps/renterd/contexts/config/transformUp.ts @@ -74,7 +74,6 @@ export function transformUpAutopilot( ...existingValues?.hosts, maxDowntimeHours: v.maxDowntimeHours.toNumber(), maxConsecutiveScanFailures: v.maxConsecutiveScanFailures.toNumber(), - allowRedundantIPs: v.allowRedundantIPs, scoreOverrides: existingValues?.hosts.scoreOverrides || {}, minProtocolVersion: v.minProtocolVersion, }, diff --git a/apps/renterd/contexts/config/types.ts b/apps/renterd/contexts/config/types.ts index 0aed43cde..e3ee2245c 100644 --- a/apps/renterd/contexts/config/types.ts +++ b/apps/renterd/contexts/config/types.ts @@ -26,7 +26,6 @@ export const inputValuesAutopilot = { storageTB: undefined as BigNumber | undefined, prune: false, // hosts - allowRedundantIPs: false, maxDowntimeHours: undefined as BigNumber | undefined, maxConsecutiveScanFailures: undefined as BigNumber | undefined, minProtocolVersion: '', @@ -135,7 +134,6 @@ export function getAdvancedDefaultsAutopilot( periodWeeks: new BigNumber(6), renewWindowWeeks: new BigNumber(2), amountHosts: new BigNumber(50), - allowRedundantIPs: false, maxDowntimeHours: new BigNumber(336), maxConsecutiveScanFailures: new BigNumber(10), minProtocolVersion: '1.6.0', @@ -145,7 +143,6 @@ export function getAdvancedDefaultsAutopilot( periodWeeks: new BigNumber(6), renewWindowWeeks: new BigNumber(2), amountHosts: new BigNumber(12), - allowRedundantIPs: false, maxDowntimeHours: new BigNumber(336), maxConsecutiveScanFailures: new BigNumber(10), minProtocolVersion: '1.6.0', diff --git a/apps/renterd/contexts/config/useAutopilotEvaluations.tsx b/apps/renterd/contexts/config/useAutopilotEvaluations.tsx index 6848046fa..ad04a76e1 100644 --- a/apps/renterd/contexts/config/useAutopilotEvaluations.tsx +++ b/apps/renterd/contexts/config/useAutopilotEvaluations.tsx @@ -461,7 +461,6 @@ export const valuesZeroDefaults: Values = { uploadTBMonth: new BigNumber(0), storageTB: new BigNumber(0), prune: false, - allowRedundantIPs: false, maxDowntimeHours: new BigNumber(0), maxConsecutiveScanFailures: new BigNumber(0), minProtocolVersion: '', diff --git a/libs/renterd-types/src/types.ts b/libs/renterd-types/src/types.ts index feeb4b159..1b6c32ee7 100644 --- a/libs/renterd-types/src/types.ts +++ b/libs/renterd-types/src/types.ts @@ -228,7 +228,6 @@ export type SiacoinElement = { } export type AutopilotHostsConfig = { - allowRedundantIPs: boolean scoreOverrides: { [key: PublicKey]: number } maxDowntimeHours: number maxConsecutiveScanFailures: number