Skip to content

Commit 59b198d

Browse files
committed
remove client settle task, add version check for client termination
1 parent 15be2a1 commit 59b198d

15 files changed

Lines changed: 603 additions & 743 deletions

cmd/curio/tasks/tasks.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -361,9 +361,8 @@ func StartTasks(ctx context.Context, dependencies *deps.Deps, shutdownChan chan
361361
pdpDelete := pdpv0.NewDeleteDataSetTask(db, must.One(dependencies.EthClient.Val()), senderEth)
362362
pdpChainDBStateSync := pdpv0.NewTaskChainSync(db, must.One(dependencies.EthClient.Val()), senderEth)
363363
payTask := pay.NewSettleTask(db, must.One(dependencies.EthClient.Val()), senderEth) // Move this to a common section once PDP v1 is live
364-
pdpClientTerminationSettle := pay.NewImmediateSettleTask(db, must.One(dependencies.EthClient.Val()), senderEth)
365364
pdpSaveCacheTask := pdpv0.NewTaskPDPSaveCache(db, dependencies.CachedPieceReader, iStore)
366-
activeTasks = append(activeTasks, pdpProveTask, pdpNotifTask, pdpPullPieceTask, pdpNextProvingPeriodTask, pdpInitProvingPeriodTask, pdpTerminate, pdpDelete, pdpChainDBStateSync, payTask, pdpClientTerminationSettle, pdpSaveCacheTask)
365+
activeTasks = append(activeTasks, pdpProveTask, pdpNotifTask, pdpPullPieceTask, pdpNextProvingPeriodTask, pdpInitProvingPeriodTask, pdpTerminate, pdpDelete, pdpChainDBStateSync, payTask, pdpSaveCacheTask)
367366
}
368367

369368
idxMax := taskhelp.Max(cfg.Subsystems.IndexingMaxTasks)

harmony/harmonydb/sql/20260520-pdp-v0-client-termination.sql

Lines changed: 0 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -46,60 +46,6 @@ BEGIN
4646
ADD COLUMN client_terminate_service_task_id BIGINT;
4747
END IF;
4848

49-
IF NOT EXISTS (
50-
SELECT 1
51-
FROM information_schema.columns
52-
WHERE table_name = 'pdp_delete_data_set'
53-
AND table_schema = current_schema()
54-
AND column_name = 'immediate_settle_task_id'
55-
) THEN
56-
ALTER TABLE pdp_delete_data_set
57-
ADD COLUMN immediate_settle_task_id BIGINT;
58-
END IF;
59-
60-
IF NOT EXISTS (
61-
SELECT 1
62-
FROM information_schema.columns
63-
WHERE table_name = 'pdp_delete_data_set'
64-
AND table_schema = current_schema()
65-
AND column_name = 'immediate_settle_tx_hash'
66-
) THEN
67-
ALTER TABLE pdp_delete_data_set
68-
ADD COLUMN immediate_settle_tx_hash TEXT;
69-
END IF;
70-
71-
IF NOT EXISTS (
72-
SELECT 1
73-
FROM information_schema.columns
74-
WHERE table_name = 'pdp_delete_data_set'
75-
AND table_schema = current_schema()
76-
AND column_name = 'after_immediate_settle'
77-
) THEN
78-
ALTER TABLE pdp_delete_data_set
79-
ADD COLUMN after_immediate_settle BOOLEAN NOT NULL DEFAULT FALSE;
80-
END IF;
81-
82-
IF NOT EXISTS (
83-
SELECT 1
84-
FROM information_schema.columns
85-
WHERE table_name = 'pdp_delete_data_set'
86-
AND table_schema = current_schema()
87-
AND column_name = 'immediate_settle_requested_at'
88-
) THEN
89-
ALTER TABLE pdp_delete_data_set
90-
ADD COLUMN immediate_settle_requested_at TIMESTAMPTZ;
91-
END IF;
92-
93-
IF NOT EXISTS (
94-
SELECT 1
95-
FROM information_schema.columns
96-
WHERE table_name = 'filecoin_payment_transactions'
97-
AND table_schema = current_schema()
98-
AND column_name = 'settle_reason'
99-
) THEN
100-
ALTER TABLE filecoin_payment_transactions
101-
ADD COLUMN settle_reason TEXT NOT NULL DEFAULT 'periodic';
102-
END IF;
10349
END
10450
$$;
10551

@@ -134,17 +80,3 @@ BEGIN
13480
END IF;
13581
END
13682
$$;
137-
138-
DO $$
139-
BEGIN
140-
IF NOT EXISTS (
141-
SELECT 1
142-
FROM pg_constraint
143-
WHERE conname = 'filecoin_payment_transactions_settle_reason_check'
144-
) THEN
145-
ALTER TABLE filecoin_payment_transactions
146-
ADD CONSTRAINT filecoin_payment_transactions_settle_reason_check
147-
CHECK (settle_reason IN ('periodic', 'pdpv0_client_termination'));
148-
END IF;
149-
END
150-
$$;

pdp/contract/FWSS/FilecoinWarmStorageService.abi

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -717,6 +717,19 @@
717717
"outputs": [],
718718
"stateMutability": "nonpayable"
719719
},
720+
{
721+
"type": "function",
722+
"name": "terminateService",
723+
"inputs": [
724+
{
725+
"name": "dataSetId",
726+
"type": "uint256",
727+
"internalType": "uint256"
728+
}
729+
],
730+
"outputs": [],
731+
"stateMutability": "nonpayable"
732+
},
720733
{
721734
"type": "function",
722735
"name": "terminateService",

pdp/contract/FWSS/FilecoinWarmStorageService.go

Lines changed: 31 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pdp/contract/FWSS/FilecoinWarmStorageServiceStateView.abi

Lines changed: 137 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,29 @@
1212
},
1313
{
1414
"type": "function",
15-
"name": "challengeWindow",
16-
"inputs": [],
17-
"outputs": [
15+
"name": "clientDataSets",
16+
"inputs": [
1817
{
19-
"name": "",
18+
"name": "payer",
19+
"type": "address",
20+
"internalType": "address"
21+
},
22+
{
23+
"name": "offset",
2024
"type": "uint256",
2125
"internalType": "uint256"
26+
},
27+
{
28+
"name": "limit",
29+
"type": "uint256",
30+
"internalType": "uint256"
31+
}
32+
],
33+
"outputs": [
34+
{
35+
"name": "dataSetIds",
36+
"type": "uint256[]",
37+
"internalType": "uint256[]"
2238
}
2339
],
2440
"stateMutability": "view"
@@ -171,16 +187,89 @@
171187
},
172188
{
173189
"type": "function",
174-
"name": "getChallengesPerProof",
175-
"inputs": [],
190+
"name": "getClientDataSets",
191+
"inputs": [
192+
{
193+
"name": "client",
194+
"type": "address",
195+
"internalType": "address"
196+
},
197+
{
198+
"name": "offset",
199+
"type": "uint256",
200+
"internalType": "uint256"
201+
},
202+
{
203+
"name": "limit",
204+
"type": "uint256",
205+
"internalType": "uint256"
206+
}
207+
],
176208
"outputs": [
177209
{
178-
"name": "",
179-
"type": "uint64",
180-
"internalType": "uint64"
210+
"name": "infos",
211+
"type": "tuple[]",
212+
"internalType": "struct FilecoinWarmStorageService.DataSetInfoView[]",
213+
"components": [
214+
{
215+
"name": "pdpRailId",
216+
"type": "uint256",
217+
"internalType": "uint256"
218+
},
219+
{
220+
"name": "cacheMissRailId",
221+
"type": "uint256",
222+
"internalType": "uint256"
223+
},
224+
{
225+
"name": "cdnRailId",
226+
"type": "uint256",
227+
"internalType": "uint256"
228+
},
229+
{
230+
"name": "payer",
231+
"type": "address",
232+
"internalType": "address"
233+
},
234+
{
235+
"name": "payee",
236+
"type": "address",
237+
"internalType": "address"
238+
},
239+
{
240+
"name": "serviceProvider",
241+
"type": "address",
242+
"internalType": "address"
243+
},
244+
{
245+
"name": "commissionBps",
246+
"type": "uint256",
247+
"internalType": "uint256"
248+
},
249+
{
250+
"name": "clientDataSetId",
251+
"type": "uint256",
252+
"internalType": "uint256"
253+
},
254+
{
255+
"name": "pdpEndEpoch",
256+
"type": "uint256",
257+
"internalType": "uint256"
258+
},
259+
{
260+
"name": "providerId",
261+
"type": "uint256",
262+
"internalType": "uint256"
263+
},
264+
{
265+
"name": "dataSetId",
266+
"type": "uint256",
267+
"internalType": "uint256"
268+
}
269+
]
181270
}
182271
],
183-
"stateMutability": "pure"
272+
"stateMutability": "view"
184273
},
185274
{
186275
"type": "function",
@@ -258,6 +347,43 @@
258347
],
259348
"stateMutability": "view"
260349
},
350+
{
351+
"type": "function",
352+
"name": "getClientDataSetsLength",
353+
"inputs": [
354+
{
355+
"name": "payer",
356+
"type": "address",
357+
"internalType": "address"
358+
}
359+
],
360+
"outputs": [
361+
{
362+
"name": "",
363+
"type": "uint256",
364+
"internalType": "uint256"
365+
}
366+
],
367+
"stateMutability": "view"
368+
},
369+
{
370+
"type": "function",
371+
"name": "getCurrentPricingRates",
372+
"inputs": [],
373+
"outputs": [
374+
{
375+
"name": "storagePrice",
376+
"type": "uint256",
377+
"internalType": "uint256"
378+
},
379+
{
380+
"name": "datasetFee",
381+
"type": "uint256",
382+
"internalType": "uint256"
383+
}
384+
],
385+
"stateMutability": "view"
386+
},
261387
{
262388
"type": "function",
263389
"name": "getDataSet",
@@ -401,19 +527,6 @@
401527
],
402528
"stateMutability": "view"
403529
},
404-
{
405-
"type": "function",
406-
"name": "getMaxProvingPeriod",
407-
"inputs": [],
408-
"outputs": [
409-
{
410-
"name": "",
411-
"type": "uint64",
412-
"internalType": "uint64"
413-
}
414-
],
415-
"stateMutability": "view"
416-
},
417530
{
418531
"type": "function",
419532
"name": "getPDPConfig",
@@ -669,4 +782,4 @@
669782
}
670783
]
671784
}
672-
]
785+
]

pdp/contract/FWSS/FilecoinWarmStorageServiceStateView.go

Lines changed: 124 additions & 79 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)