Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: PDP #227

Draft
wants to merge 71 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
fc7399d
pdp: Inital scaffold
magik6k Sep 30, 2024
40aad8c
pdp: Drop unneded handlers
magik6k Oct 1, 2024
e3ad509
pdp: wip uploads
magik6k Oct 1, 2024
ececf7c
pdp: Proper pieceref tracking
magik6k Oct 2, 2024
ed8c966
storage: Implement local stash storage
magik6k Oct 2, 2024
afa54ec
storage: Make Local use a single URL
magik6k Oct 2, 2024
794d167
pdp: Complete upload
magik6k Oct 2, 2024
6f36c6b
piecepark: Special long-term storage mode
magik6k Oct 2, 2024
041675a
dealdata: Handle custore://
magik6k Oct 2, 2024
4daac0c
pdp: Notify task
magik6k Oct 3, 2024
cf7ae93
retrieval: Foundations for PiecePark readers
magik6k Oct 3, 2024
2082fe9
retrieval: Parked piece /piece retrievals
magik6k Oct 3, 2024
cea21f7
pdptool for interacting with curio pdp endpoints
magik6k Oct 3, 2024
76634fd
pdp webui: Basic page, adding services through UI
magik6k Oct 3, 2024
14487f2
pdp webui: Remove service button
magik6k Oct 3, 2024
7ef7681
get http server cert cache working
magik6k Oct 3, 2024
a773193
pdp: server and tool ping functionality
magik6k Oct 3, 2024
5cdf4a2
slowly getting data import to actually work
magik6k Oct 4, 2024
51d0d28
separate pdp task config
magik6k Oct 4, 2024
79e6f1b
make gen
magik6k Oct 4, 2024
66a2c41
basic pdp key management
magik6k Oct 4, 2024
c7f676f
eth sender
magik6k Oct 7, 2024
37c327d
more working pdp message sender
magik6k Oct 7, 2024
bf1c121
initial eth waiter
magik6k Oct 7, 2024
d828a8d
eth waiter fixes
magik6k Oct 7, 2024
eb5dd69
wip impl /create-proofset
magik6k Oct 7, 2024
cc72018
wire up proofset create
magik6k Oct 7, 2024
8336ce8
pdptool: Add a tool for proofset-create
magik6k Oct 7, 2024
551c65a
gas estimation in eth sender
magik6k Oct 7, 2024
caf57c0
proofset receipt parsing
magik6k Oct 8, 2024
986151b
pdp: Endpoint to get proofset creation status
magik6k Oct 8, 2024
511125e
pdp: get-proof-set endpoint
magik6k Oct 8, 2024
9fbf574
pdp: Add-root endpoint
magik6k Oct 9, 2024
752d9b4
pdp: Separate table for root adds
magik6k Oct 9, 2024
ee7e30f
pdp: Working root adds
magik6k Oct 9, 2024
dd6a47c
pdp: Add-root watcher
magik6k Oct 9, 2024
b73adc2
pdp: working root adding
magik6k Oct 9, 2024
8c4e566
pdp: Watch challenge epochs
magik6k Oct 10, 2024
e06f759
pdp: Scaffold prove task
magik6k Oct 10, 2024
4f50a46
pdp: Prove scheduling
magik6k Oct 10, 2024
07ad29f
pdp: Path from challenge to prove
magik6k Oct 10, 2024
7e1798a
proof: Sha memtree
magik6k Oct 10, 2024
04b4bc5
proof: Binary memtree proover
magik6k Oct 10, 2024
67ba074
pdp: Require sorted subroot pieces
magik6k Oct 11, 2024
5538028
pdp: Getting there with proof verification
magik6k Oct 11, 2024
b26d885
pdp: Proof bugfixing progress
magik6k Oct 12, 2024
eeca445
pdp: PROOFS WORK!
magik6k Oct 12, 2024
a03ba8d
pdp: An actually working poller this time
magik6k Oct 12, 2024
c555027
pdp: better praams
magik6k Oct 13, 2024
b910e95
pdp: Update contarcts
magik6k Oct 22, 2024
ecc52c9
make gen, consistent max piece size
magik6k Oct 22, 2024
2e4f9b9
fix local path test
magik6k Oct 22, 2024
2adff15
pdp: Implement fees
magik6k Oct 22, 2024
16ccaad
pdp chall lookback in prove
magik6k Oct 22, 2024
4ac1e85
update to new proving scheme
magik6k Oct 23, 2024
2cea05f
small fixes
magik6k Oct 23, 2024
7513819
pdp: Support arbitrary hash funcs in uploads
magik6k Oct 24, 2024
ff3d92f
pdp: api readme
magik6k Oct 24, 2024
3190e7c
fix lint
magik6k Oct 24, 2024
4cb6643
feat(pdp): add endpoint to poll for completed upload (#304)
hannahhoward Oct 30, 2024
143411a
enable chain sched with just eth sender
magik6k Nov 1, 2024
4b70e1d
feat(pdp): add ed25519 support for JWT (#323)
hannahhoward Nov 9, 2024
921be6f
fix(pdp): fix ed25519 auth (#324)
hannahhoward Nov 10, 2024
7375a08
Zen/update interface (#334)
ZenGround0 Dec 11, 2024
88659ba
Integrate pdp updates -- nextProvingPeriod called after first add (#347)
ZenGround0 Jan 28, 2025
8a788b6
Delete pdp roots from proofset (#384)
ZenGround0 Jan 28, 2025
db1cf8e
Merge remote-tracking branch 'origin/main' into feat/pdp2
magik6k Jan 28, 2025
092e15f
make gen
magik6k Jan 28, 2025
dce9f17
drop some unused things
magik6k Jan 29, 2025
a29c049
crypto rand in pdptool
magik6k Jan 29, 2025
c2316aa
reduce log verbosity, ethwaits index
magik6k Jan 29, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 59 additions & 4 deletions cmd/curio/tasks/tasks.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import (
"github.com/filecoin-project/curio/tasks/indexing"
"github.com/filecoin-project/curio/tasks/message"
"github.com/filecoin-project/curio/tasks/metadata"
"github.com/filecoin-project/curio/tasks/pdp"
piece2 "github.com/filecoin-project/curio/tasks/piece"
"github.com/filecoin-project/curio/tasks/scrub"
"github.com/filecoin-project/curio/tasks/seal"
Expand Down Expand Up @@ -98,7 +99,7 @@ func StartTasks(ctx context.Context, dependencies *deps.Deps, shutdownChan chan
machine := dependencies.ListenAddr
prover := dependencies.Prover
iStore := dependencies.IndexStore
pp := dependencies.PieceProvider
pp := dependencies.SectorReader

var activeTasks []harmonytask.TaskInterface

Expand Down Expand Up @@ -139,6 +140,24 @@ func StartTasks(ctx context.Context, dependencies *deps.Deps, shutdownChan chan
}
}

// eth message sender as needed
var senderEth *message.SenderETH
var senderEthOnce sync.Once
var getSenderEth = func() *message.SenderETH {
senderEthOnce.Do(func() {
ec, err := dependencies.EthClient.Val()
if err != nil {
log.Errorw("failed to get eth client", "error", err)
return
}

var ethSenderTask *message.SendTaskETH
senderEth, ethSenderTask = message.NewSenderETH(ec, db)
activeTasks = append(activeTasks, ethSenderTask)
})
return senderEth
}

///////////////////////////////////////////////////////////////////////
///// Task Selection
///////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -249,14 +268,30 @@ func StartTasks(ctx context.Context, dependencies *deps.Deps, shutdownChan chan
go libp2p.NewDealProvider(ctx, db, cfg, dm.MK12Handler, full, sender, miners, machine, shutdownChan)
}

var sdeps cuhttp.ServiceDeps

if cfg.Subsystems.EnablePDP {
es := getSenderEth()
sdeps.EthSender = es

pdp.NewWatcherCreate(db, must.One(dependencies.EthClient.Val()), chainSched)
pdp.NewWatcherRootAdd(db, must.One(dependencies.EthClient.Val()), chainSched)

pdpProveTask := pdp.NewProveTask(chainSched, db, must.One(dependencies.EthClient.Val()), dependencies.Chain, es, dependencies.CachedPieceReader)
pdpNextProvingPeriodTask := pdp.NewNextProvingPeriodTask(db, must.One(dependencies.EthClient.Val()), dependencies.Chain, chainSched, es)
pdpInitProvingPeriodTask := pdp.NewInitProvingPeriodTask(db, must.One(dependencies.EthClient.Val()), dependencies.Chain, chainSched, es)
pdpNotifTask := pdp.NewPDPNotifyTask(db)
activeTasks = append(activeTasks, pdpNotifTask, pdpProveTask, pdpNextProvingPeriodTask, pdpInitProvingPeriodTask)
}

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

indexingTask := indexing.NewIndexingTask(db, sc, iStore, pp, cfg, idxMax)
ipniTask := indexing.NewIPNITask(db, sc, iStore, pp, cfg, idxMax)
activeTasks = append(activeTasks, ipniTask, indexingTask)

if cfg.HTTP.Enable {
err = cuhttp.StartHTTPServer(ctx, dependencies)
err = cuhttp.StartHTTPServer(ctx, dependencies, &sdeps)
if err != nil {
return nil, xerrors.Errorf("failed to start the HTTP server: %w", err)
}
Expand Down Expand Up @@ -290,7 +325,16 @@ func StartTasks(ctx context.Context, dependencies *deps.Deps, shutdownChan chan
_ = watcher
}

if cfg.Subsystems.EnableWindowPost || hasAnySealingTask {
if senderEth != nil {
watcherEth, err := message.NewMessageWatcherEth(db, ht, chainSched, must.One(dependencies.EthClient.Val()))
if err != nil {
return nil, err
}
_ = watcherEth

}

if cfg.Subsystems.EnableWindowPost || hasAnySealingTask || senderEth != nil {
go chainSched.Run(ctx)
}

Expand Down Expand Up @@ -374,7 +418,18 @@ func addSealingTasks(
if cfg.Subsystems.EnableMoveStorage {
moveStorageTask := seal.NewMoveStorageTask(sp, slr, db, cfg.Subsystems.MoveStorageMaxTasks)
moveStorageSnapTask := snap.NewMoveStorageTask(slr, db, cfg.Subsystems.MoveStorageMaxTasks)
activeTasks = append(activeTasks, moveStorageTask, moveStorageSnapTask)

storePieceTask, err := piece2.NewStorePieceTask(db, must.One(slrLazy.Val()), stor, cfg.Subsystems.MoveStorageMaxTasks)
if err != nil {
return nil, err
}

activeTasks = append(activeTasks, moveStorageTask, moveStorageSnapTask, storePieceTask)
if !cfg.Subsystems.EnableParkPiece {
// add cleanup if it's not added above with park piece
cleanupPieceTask := piece2.NewCleanupPieceTask(db, must.One(slrLazy.Val()), 0)
activeTasks = append(activeTasks, cleanupPieceTask)
}

if !cfg.Subsystems.NoUnsealedDecode {
unsealTask := unseal.NewTaskUnsealDecode(slr, db, cfg.Subsystems.MoveStorageMaxTasks, full)
Expand Down
Loading
Loading