From 640c68278805b131caf2bd4e55f7b7590df064e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Fri, 15 Nov 2024 18:46:07 +0100 Subject: [PATCH] make gen, fix lint --- cmd/curio/tasks/tasks.go | 2 +- lib/ffi/sdr_funcs.go | 6 +++--- tasks/sealsupra/task_supraseal.go | 5 +++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/cmd/curio/tasks/tasks.go b/cmd/curio/tasks/tasks.go index d29a37ab8..4aa333c3d 100644 --- a/cmd/curio/tasks/tasks.go +++ b/cmd/curio/tasks/tasks.go @@ -274,7 +274,7 @@ func addSealingTasks( cfg.Seal.BatchSealPipelines, !cfg.Seal.SingleHasherPerThread, cfg.Seal.LayerNVMEDevices, - machineHostPort, slotMgr, db, full, stor, si) + machineHostPort, slotMgr, db, full, stor, si, slr) if err != nil { return nil, xerrors.Errorf("setting up batch sealer: %w", err) } diff --git a/lib/ffi/sdr_funcs.go b/lib/ffi/sdr_funcs.go index 4aa2599f1..538a02d5f 100644 --- a/lib/ffi/sdr_funcs.go +++ b/lib/ffi/sdr_funcs.go @@ -5,7 +5,6 @@ import ( "crypto/rand" "encoding/json" "fmt" - "github.com/samber/lo" "io" "os" "path/filepath" @@ -15,6 +14,7 @@ import ( "github.com/ipfs/go-cid" logging "github.com/ipfs/go-log/v2" "github.com/puzpuzpuz/xsync/v2" + "github.com/samber/lo" "golang.org/x/xerrors" "github.com/filecoin-project/curio/harmony/harmonytask" @@ -75,8 +75,8 @@ func (l *storageProvider) AcquireSector(ctx context.Context, taskID *harmonytask var ok bool var resv *StorageReservation if taskID != nil { - resvs, ok := l.storageReservations.Load(*taskID) - if ok { + resvs, rok := l.storageReservations.Load(*taskID) + if rok { resv, ok = lo.Find(resvs, func(res *StorageReservation) bool { return res.SectorRef.ID() == sector.ID }) diff --git a/tasks/sealsupra/task_supraseal.go b/tasks/sealsupra/task_supraseal.go index e37ac13e9..9254df69e 100644 --- a/tasks/sealsupra/task_supraseal.go +++ b/tasks/sealsupra/task_supraseal.go @@ -5,7 +5,6 @@ import ( "encoding/hex" "encoding/json" "fmt" - "github.com/filecoin-project/curio/lib/ffi" "os" "path/filepath" "time" @@ -26,6 +25,7 @@ import ( "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/curio/lib/ffi" "github.com/filecoin-project/curio/lib/hugepageutil" "github.com/filecoin-project/curio/lib/passcall" "github.com/filecoin-project/curio/lib/paths" @@ -64,7 +64,7 @@ type SupraSeal struct { } func NewSupraSeal(sectorSize string, batchSize, pipelines int, dualHashers bool, nvmeDevices []string, machineHostAndPort string, - slots *slotmgr.SlotMgr, db *harmonydb.DB, api SupraSealNodeAPI, storage *paths.Remote, sindex paths.SectorIndex) (*SupraSeal, error) { + slots *slotmgr.SlotMgr, db *harmonydb.DB, api SupraSealNodeAPI, storage *paths.Remote, sindex paths.SectorIndex, sc *ffi.SealCalls) (*SupraSeal, error) { var spt abi.RegisteredSealProof switch sectorSize { case "32GiB": @@ -222,6 +222,7 @@ func NewSupraSeal(sectorSize string, batchSize, pipelines int, dualHashers bool, api: api, storage: storage, sindex: sindex, + sc: sc, spt: spt, pipelines: pipelines,