-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathconstants.ts
More file actions
53 lines (50 loc) · 1.99 KB
/
Copy pathconstants.ts
File metadata and controls
53 lines (50 loc) · 1.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import { SUPPORTED_NETWORKS } from "../common/constants.js";
import type { Network } from "../common/types.js";
import { NetworkDefaults } from "./types.js";
/**
* Default values applied to every network config when the corresponding env
* var is absent. Override per-network via `<NETWORK>_*` env vars.
*/
export const networkDefaults = {
checkDatasetCreationFees: true,
useOnlyApprovedProviders: true,
minNumDataSetsForChecks: 1,
rpcRequestTimeoutMs: 30000,
dealsPerSpPerHour: 4,
dealJobTimeoutSeconds: 360,
retrievalsPerSpPerHour: 2,
sampledRetrievalsPerSpPerHour: 2,
retrievalJobTimeoutSeconds: 60,
sampledRetrievalJobTimeoutSeconds: 360,
dataSetCreationsPerSpPerHour: 1,
dataSetCreationJobTimeoutSeconds: 300,
dataSetLifecycleChecksPerSpPerHour: 1,
dataSetLifecycleCheckJobTimeoutSeconds: 600,
pieceCleanupPerSpPerHour: 1 / 24,
maxPieceCleanupRuntimeSeconds: 300,
dataRetentionPollIntervalSeconds: 3600,
providersRefreshIntervalSeconds: 4 * 3600,
maintenanceWindowsUtc: ["07:00", "22:00"],
maintenanceWindowMinutes: 20,
maxDatasetStorageSizeBytes: 24 * 1024 * 1024 * 1024, // 24 GiB
targetDatasetStorageSizeBytes: 20 * 1024 * 1024 * 1024, // 20 GiB
pullChecksPerSpPerHour: 1,
pullCheckJobTimeoutSeconds: 300,
pullCheckPollIntervalSeconds: 2,
pullCheckPieceSizeBytes: 10 * 1024 * 1024, // 10 MiB
pullPieceCleanupIntervalSeconds: 7 * 24 * 3600, // 7 days
} satisfies NetworkDefaults;
/**
* Fixed rates and dataset target for eligible providers outside the full-rate
* tier. Kept non-configurable to limit wallet-spend exposure.
*/
export const trickleTierRates = {
dealsPerSpPerHour: 1 / 4, // 1 data-storage check every 4 hours
dataSetCreationsPerSpPerHour: 1 / 4, // 1 data-set-creation tick every 4 hours
minNumDataSetsForChecks: 1,
} as const;
/**
* Uppercase env-var prefixes for every supported network, e.g.
* `["CALIBRATION", "MAINNET"]`
*/
export const NETWORK_ENV_PREFIXES = SUPPORTED_NETWORKS.map((n) => n.toUpperCase()) as Uppercase<Network>[];