Skip to content

Commit

Permalink
Unseal (#181)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
magik6k authored Sep 16, 2024
1 parent dd93238 commit b2e2def
Show file tree
Hide file tree
Showing 66 changed files with 3,443 additions and 90 deletions.
18 changes: 17 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,22 @@ BUILD_DEPS+=ffi-version-check

.PHONY: ffi-version-check

## BLST (from supraseal, but needed in curio)

BLST_PATH:=extern/supra_seal/
BLST_DEPS:=.install-blst
BLST_DEPS:=$(addprefix $(BLST_PATH),$(BLST_DEPS))

$(BLST_DEPS): build/.blst-install ;

build/.blst-install: $(BLST_PATH)
bash scripts/build-blst.sh
@touch $@

MODULES+=$(BLST_PATH)
BUILD_DEPS+=build/.blst-install
CLEAN+=build/.blst-install

## SUPRA-FFI

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

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

Expand Down
3 changes: 2 additions & 1 deletion alertmanager/task_alert.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
"github.com/filecoin-project/curio/harmony/harmonydb"
"github.com/filecoin-project/curio/harmony/harmonytask"
"github.com/filecoin-project/curio/harmony/resources"
"github.com/filecoin-project/curio/harmony/taskhelp"

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

func (a *AlertTask) TypeDetails() harmonytask.TaskTypeDetails {
return harmonytask.TaskTypeDetails{
Max: 1,
Max: taskhelp.Max(1),
Name: "AlertManager",
Cost: resources.Resources{
Cpu: 1,
Expand Down
1 change: 1 addition & 0 deletions cmd/curio/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ func main() {
webCmd,
guidedsetup.GuidedsetupCmd,
sealCmd,
unsealCmd,
marketCmd,
fetchParamCmd,
ffiCmd,
Expand Down
File renamed without changes.
21 changes: 19 additions & 2 deletions cmd/curio/tasks/tasks.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"github.com/filecoin-project/curio/deps/config"
"github.com/filecoin-project/curio/harmony/harmonydb"
"github.com/filecoin-project/curio/harmony/harmonytask"
"github.com/filecoin-project/curio/harmony/taskhelp"
"github.com/filecoin-project/curio/lib/chainsched"
"github.com/filecoin-project/curio/lib/curiochain"
"github.com/filecoin-project/curio/lib/fastparamfetch"
Expand All @@ -35,9 +36,11 @@ import (
"github.com/filecoin-project/curio/tasks/message"
"github.com/filecoin-project/curio/tasks/metadata"
piece2 "github.com/filecoin-project/curio/tasks/piece"
"github.com/filecoin-project/curio/tasks/scrub"
"github.com/filecoin-project/curio/tasks/seal"
"github.com/filecoin-project/curio/tasks/sealsupra"
"github.com/filecoin-project/curio/tasks/snap"
"github.com/filecoin-project/curio/tasks/unseal"
window2 "github.com/filecoin-project/curio/tasks/window"
"github.com/filecoin-project/curio/tasks/winning"

Expand Down Expand Up @@ -250,6 +253,11 @@ func addSealingTasks(
var addFinalize bool

// NOTE: Tasks with the LEAST priority are at the top
if cfg.Subsystems.EnableCommP {
scrubUnsealedTask := scrub.NewCommDCheckTask(db, slr)
activeTasks = append(activeTasks, scrubUnsealedTask)
}

if cfg.Subsystems.EnableBatchSeal {
slotMgr = slotmgr.NewSlotMgr()

Expand All @@ -268,8 +276,12 @@ func addSealingTasks(
}

if cfg.Subsystems.EnableSealSDR {
sdrTask := seal.NewSDRTask(full, db, sp, slr, cfg.Subsystems.SealSDRMaxTasks, cfg.Subsystems.SealSDRMinTasks)
activeTasks = append(activeTasks, sdrTask)
sdrMax := taskhelp.Max(cfg.Subsystems.SealSDRMaxTasks)

sdrTask := seal.NewSDRTask(full, db, sp, slr, sdrMax, cfg.Subsystems.SealSDRMinTasks)
keyTask := unseal.NewTaskUnsealSDR(slr, db, sdrMax, full)

activeTasks = append(activeTasks, sdrTask, keyTask)
}
if cfg.Subsystems.EnableSealSDRTrees {
treeDTask := seal.NewTreeDTask(sp, db, slr, cfg.Subsystems.SealSDRTreesMaxTasks)
Expand All @@ -295,6 +307,11 @@ func addSealingTasks(
moveStorageTask := seal.NewMoveStorageTask(sp, slr, db, cfg.Subsystems.MoveStorageMaxTasks)
moveStorageSnapTask := snap.NewMoveStorageTask(slr, db, cfg.Subsystems.MoveStorageMaxTasks)
activeTasks = append(activeTasks, moveStorageTask, moveStorageSnapTask)

if !cfg.Subsystems.NoUnsealedDecode {
unsealTask := unseal.NewTaskUnsealDecode(slr, db, cfg.Subsystems.MoveStorageMaxTasks, full)
activeTasks = append(activeTasks, unsealTask)
}
}
if cfg.Subsystems.EnableSendCommitMsg {
commitTask := seal.NewSubmitCommitTask(sp, db, full, sender, as, cfg)
Expand Down
Loading

0 comments on commit b2e2def

Please sign in to comment.