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

Fix WinningPoSt with remote sectors #48

Merged
merged 1 commit into from
Jun 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions cmd/curio/tasks/tasks.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ func StartTasks(ctx context.Context, dependencies *deps.Deps) (*harmonytask.Task
}

if cfg.Subsystems.EnableWinningPost {
pl := dependencies.LocalStore
winPoStTask := winning.NewWinPostTask(cfg.Subsystems.WinningPostMaxTasks, db, pl, verif, asyncParams(), full, maddrs)
store := dependencies.Stor
winPoStTask := winning.NewWinPostTask(cfg.Subsystems.WinningPostMaxTasks, db, store, verif, asyncParams(), full, maddrs)
inclCkTask := winning.NewInclusionCheckTask(db, full)
activeTasks = append(activeTasks, winPoStTask, inclCkTask)
}
Expand Down
10 changes: 5 additions & 5 deletions tasks/winning/winning_task.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ type WinPostTask struct {
max int
db *harmonydb.DB

paths *paths.Local
paths *paths.Remote
verifier storiface.Verifier
paramsReady func() (bool, error)

Expand Down Expand Up @@ -72,11 +72,11 @@ type WinPostAPI interface {
WalletSign(context.Context, address.Address, []byte) (*crypto.Signature, error)
}

func NewWinPostTask(max int, db *harmonydb.DB, pl *paths.Local, verifier storiface.Verifier, paramck func() (bool, error), api WinPostAPI, actors map[dtypes.MinerAddress]bool) *WinPostTask {
func NewWinPostTask(max int, db *harmonydb.DB, remote *paths.Remote, verifier storiface.Verifier, paramck func() (bool, error), api WinPostAPI, actors map[dtypes.MinerAddress]bool) *WinPostTask {
t := &WinPostTask{
max: max,
db: db,
paths: pl,
paths: remote,
verifier: verifier,
paramsReady: paramck,
api: api,
Expand Down Expand Up @@ -455,10 +455,10 @@ func (t *WinPostTask) generateWinningPost(
eg.Go(func() error {
vanilla, err := t.paths.GenerateSingleVanillaProof(ctx, mid, s, ppt)
if err != nil {
return xerrors.Errorf("get winning sector:%d,vanila failed: %w", s.SectorNumber, err)
return xerrors.Errorf("get winning sector:%d, vanilla failed: %w", s.SectorNumber, err)
}
if vanilla == nil {
return xerrors.Errorf("get winning sector:%d,vanila is nil", s.SectorNumber)
return xerrors.Errorf("get winning sector:%d, vanilla is nil", s.SectorNumber)
}
vproofs[i] = vanilla
return nil
Expand Down