Skip to content

Commit b2e2def

Browse files
authored
Unseal (#181)
* Start unseal impl * Complete Generate Key * Decode SDR func * most of SDR unseal * Fix an unholy out-of-order decode issue * storiface: standardize .tmp somewhat * make gen * wip snap * What * snap unseal test * add logging * phi-only test * SNAP DECODE WOOOORKS!!! * cleanup logging * parallel snap decode * select rhos on the fly * snap decode SealCall * unseal scheduling * Plumb unseal to curio run * make: Always build blst * CLI for managing unseals * Unseal preference aware GC * Fix into handling in GenerateSDR * Oh no, snap is outputting corrupted metadata * Deal with #191 * make gen * get unseal fully working * scrub unsealed command * fix unseal check * unseal: Use correct CID in decode * gc: Don't mark sectors still in unseal pipeline for removal * unseal pipeline gc * make gen * fix snap decode readers * config: EnableScrubUnsealed->EnableCommP * harmony: Advanced max counters * make gen * address review * make gen * harmony: Put max counter Limiter behind an interface
1 parent dd93238 commit b2e2def

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+3443
-90
lines changed

Makefile

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,22 @@ BUILD_DEPS+=ffi-version-check
2424

2525
.PHONY: ffi-version-check
2626

27+
## BLST (from supraseal, but needed in curio)
28+
29+
BLST_PATH:=extern/supra_seal/
30+
BLST_DEPS:=.install-blst
31+
BLST_DEPS:=$(addprefix $(BLST_PATH),$(BLST_DEPS))
32+
33+
$(BLST_DEPS): build/.blst-install ;
34+
35+
build/.blst-install: $(BLST_PATH)
36+
bash scripts/build-blst.sh
37+
@touch $@
38+
39+
MODULES+=$(BLST_PATH)
40+
BUILD_DEPS+=build/.blst-install
41+
CLEAN+=build/.blst-install
42+
2743
## SUPRA-FFI
2844

2945
ifeq ($(shell uname),Linux)
@@ -37,7 +53,7 @@ build/.supraseal-install: $(SUPRA_FFI_PATH)
3753
cd $(SUPRA_FFI_PATH) && ./build.sh
3854
@touch $@
3955

40-
MODULES+=$(SUPRA_FFI_PATH)
56+
# MODULES+=$(SUPRA_FFI_PATH) -- already included in BLST_PATH
4157
CLEAN+=build/.supraseal-install
4258
endif
4359

alertmanager/task_alert.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import (
1919
"github.com/filecoin-project/curio/harmony/harmonydb"
2020
"github.com/filecoin-project/curio/harmony/harmonytask"
2121
"github.com/filecoin-project/curio/harmony/resources"
22+
"github.com/filecoin-project/curio/harmony/taskhelp"
2223

2324
"github.com/filecoin-project/lotus/api"
2425
"github.com/filecoin-project/lotus/chain/types"
@@ -161,7 +162,7 @@ func (a *AlertTask) CanAccept(ids []harmonytask.TaskID, engine *harmonytask.Task
161162

162163
func (a *AlertTask) TypeDetails() harmonytask.TaskTypeDetails {
163164
return harmonytask.TaskTypeDetails{
164-
Max: 1,
165+
Max: taskhelp.Max(1),
165166
Name: "AlertManager",
166167
Cost: resources.Resources{
167168
Cpu: 1,

cmd/curio/main.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ func main() {
6464
webCmd,
6565
guidedsetup.GuidedsetupCmd,
6666
sealCmd,
67+
unsealCmd,
6768
marketCmd,
6869
fetchParamCmd,
6970
ffiCmd,
File renamed without changes.

cmd/curio/tasks/tasks.go

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import (
2323
"github.com/filecoin-project/curio/deps/config"
2424
"github.com/filecoin-project/curio/harmony/harmonydb"
2525
"github.com/filecoin-project/curio/harmony/harmonytask"
26+
"github.com/filecoin-project/curio/harmony/taskhelp"
2627
"github.com/filecoin-project/curio/lib/chainsched"
2728
"github.com/filecoin-project/curio/lib/curiochain"
2829
"github.com/filecoin-project/curio/lib/fastparamfetch"
@@ -35,9 +36,11 @@ import (
3536
"github.com/filecoin-project/curio/tasks/message"
3637
"github.com/filecoin-project/curio/tasks/metadata"
3738
piece2 "github.com/filecoin-project/curio/tasks/piece"
39+
"github.com/filecoin-project/curio/tasks/scrub"
3840
"github.com/filecoin-project/curio/tasks/seal"
3941
"github.com/filecoin-project/curio/tasks/sealsupra"
4042
"github.com/filecoin-project/curio/tasks/snap"
43+
"github.com/filecoin-project/curio/tasks/unseal"
4144
window2 "github.com/filecoin-project/curio/tasks/window"
4245
"github.com/filecoin-project/curio/tasks/winning"
4346

@@ -250,6 +253,11 @@ func addSealingTasks(
250253
var addFinalize bool
251254

252255
// NOTE: Tasks with the LEAST priority are at the top
256+
if cfg.Subsystems.EnableCommP {
257+
scrubUnsealedTask := scrub.NewCommDCheckTask(db, slr)
258+
activeTasks = append(activeTasks, scrubUnsealedTask)
259+
}
260+
253261
if cfg.Subsystems.EnableBatchSeal {
254262
slotMgr = slotmgr.NewSlotMgr()
255263

@@ -268,8 +276,12 @@ func addSealingTasks(
268276
}
269277

270278
if cfg.Subsystems.EnableSealSDR {
271-
sdrTask := seal.NewSDRTask(full, db, sp, slr, cfg.Subsystems.SealSDRMaxTasks, cfg.Subsystems.SealSDRMinTasks)
272-
activeTasks = append(activeTasks, sdrTask)
279+
sdrMax := taskhelp.Max(cfg.Subsystems.SealSDRMaxTasks)
280+
281+
sdrTask := seal.NewSDRTask(full, db, sp, slr, sdrMax, cfg.Subsystems.SealSDRMinTasks)
282+
keyTask := unseal.NewTaskUnsealSDR(slr, db, sdrMax, full)
283+
284+
activeTasks = append(activeTasks, sdrTask, keyTask)
273285
}
274286
if cfg.Subsystems.EnableSealSDRTrees {
275287
treeDTask := seal.NewTreeDTask(sp, db, slr, cfg.Subsystems.SealSDRTreesMaxTasks)
@@ -295,6 +307,11 @@ func addSealingTasks(
295307
moveStorageTask := seal.NewMoveStorageTask(sp, slr, db, cfg.Subsystems.MoveStorageMaxTasks)
296308
moveStorageSnapTask := snap.NewMoveStorageTask(slr, db, cfg.Subsystems.MoveStorageMaxTasks)
297309
activeTasks = append(activeTasks, moveStorageTask, moveStorageSnapTask)
310+
311+
if !cfg.Subsystems.NoUnsealedDecode {
312+
unsealTask := unseal.NewTaskUnsealDecode(slr, db, cfg.Subsystems.MoveStorageMaxTasks, full)
313+
activeTasks = append(activeTasks, unsealTask)
314+
}
298315
}
299316
if cfg.Subsystems.EnableSendCommitMsg {
300317
commitTask := seal.NewSubmitCommitTask(sp, db, full, sender, as, cfg)

0 commit comments

Comments
 (0)