From caf62d937011ef01384e8c74724637cf7c4bd97a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Fri, 16 Feb 2024 21:27:15 +0100 Subject: [PATCH] fix addresssel post-rebase --- cmd/lotus-provider/config_migrate.go | 2 +- cmd/lotus-provider/config_new.go | 9 ++++++++- provider/lpseal/task_submit_commit.go | 8 ++++---- provider/lpseal/task_submit_precommit.go | 8 ++++---- 4 files changed, 17 insertions(+), 10 deletions(-) diff --git a/cmd/lotus-provider/config_migrate.go b/cmd/lotus-provider/config_migrate.go index 7b395d5a9..572a798a5 100644 --- a/cmd/lotus-provider/config_migrate.go +++ b/cmd/lotus-provider/config_migrate.go @@ -125,7 +125,7 @@ func fromMiner(cctx *cli.Context) (err error) { return fmt.Errorf("could not read config.toml: %w", err) } lpCfg := config.DefaultLotusProvider() - _, err = deps.LoadConfigWithUpgrades(string(buf), &lpCfg) + _, err = deps.LoadConfigWithUpgrades(string(buf), lpCfg) if err != nil { return fmt.Errorf("could not decode toml: %w", err) } diff --git a/cmd/lotus-provider/config_new.go b/cmd/lotus-provider/config_new.go index da194d223..38949959a 100644 --- a/cmd/lotus-provider/config_new.go +++ b/cmd/lotus-provider/config_new.go @@ -86,7 +86,14 @@ var configNewCmd = &cli.Command{ return xerrors.Errorf("Failed to get miner info: %w", err) } - lpCfg.Addresses.MinerAddresses = append(lpCfg.Addresses.MinerAddresses, addr) + lpCfg.Addresses = append(lpCfg.Addresses, config.LotusProviderAddresses{ + PreCommitControl: nil, + CommitControl: nil, + TerminateControl: nil, + DisableOwnerFallback: false, + DisableWorkerFallback: false, + MinerAddresses: []string{addr}, + }) } { diff --git a/provider/lpseal/task_submit_commit.go b/provider/lpseal/task_submit_commit.go index 793b15618..789f8833e 100644 --- a/provider/lpseal/task_submit_commit.go +++ b/provider/lpseal/task_submit_commit.go @@ -3,6 +3,7 @@ package lpseal import ( "bytes" "context" + "github.com/filecoin-project/lotus/provider/multictladdr" "golang.org/x/xerrors" @@ -19,7 +20,6 @@ import ( "github.com/filecoin-project/lotus/lib/harmony/resources" "github.com/filecoin-project/lotus/provider/lpmessage" "github.com/filecoin-project/lotus/storage/ctladdr" - sealing "github.com/filecoin-project/lotus/storage/pipeline" ) type SubmitCommitAPI interface { @@ -36,12 +36,12 @@ type SubmitCommitTask struct { api SubmitCommitAPI sender *lpmessage.Sender - as sealing.AddressSelector + as *multictladdr.MultiAddressSelector maxFee types.FIL } -func NewSubmitCommitTask(sp *SealPoller, db *harmonydb.DB, api SubmitCommitAPI, sender *lpmessage.Sender, as sealing.AddressSelector, maxFee types.FIL) *SubmitCommitTask { +func NewSubmitCommitTask(sp *SealPoller, db *harmonydb.DB, api SubmitCommitAPI, sender *lpmessage.Sender, as *multictladdr.MultiAddressSelector, maxFee types.FIL) *SubmitCommitTask { return &SubmitCommitTask{ sp: sp, db: db, @@ -118,7 +118,7 @@ func (s *SubmitCommitTask) Do(taskID harmonytask.TaskID, stillOwned func() bool) collateral = big.Zero() } - a, _, err := s.as.AddressFor(ctx, s.api, mi, api.CommitAddr, collateral, big.Zero()) + a, _, err := s.as.AddressFor(ctx, s.api, maddr, mi, api.CommitAddr, collateral, big.Zero()) if err != nil { return false, xerrors.Errorf("getting address for precommit: %w", err) } diff --git a/provider/lpseal/task_submit_precommit.go b/provider/lpseal/task_submit_precommit.go index 09c9379ac..e6306f2b8 100644 --- a/provider/lpseal/task_submit_precommit.go +++ b/provider/lpseal/task_submit_precommit.go @@ -3,6 +3,7 @@ package lpseal import ( "bytes" "context" + "github.com/filecoin-project/lotus/provider/multictladdr" "github.com/ipfs/go-cid" "golang.org/x/xerrors" @@ -21,7 +22,6 @@ import ( "github.com/filecoin-project/lotus/lib/harmony/resources" "github.com/filecoin-project/lotus/provider/lpmessage" "github.com/filecoin-project/lotus/storage/ctladdr" - sealing "github.com/filecoin-project/lotus/storage/pipeline" ) type SubmitPrecommitTaskApi interface { @@ -35,12 +35,12 @@ type SubmitPrecommitTask struct { db *harmonydb.DB api SubmitPrecommitTaskApi sender *lpmessage.Sender - as sealing.AddressSelector + as *multictladdr.MultiAddressSelector maxFee types.FIL } -func NewSubmitPrecommitTask(sp *SealPoller, db *harmonydb.DB, api SubmitPrecommitTaskApi, sender *lpmessage.Sender, as sealing.AddressSelector, maxFee types.FIL) *SubmitPrecommitTask { +func NewSubmitPrecommitTask(sp *SealPoller, db *harmonydb.DB, api SubmitPrecommitTaskApi, sender *lpmessage.Sender, as *multictladdr.MultiAddressSelector, maxFee types.FIL) *SubmitPrecommitTask { return &SubmitPrecommitTask{ sp: sp, db: db, @@ -146,7 +146,7 @@ func (s *SubmitPrecommitTask) Do(taskID harmonytask.TaskID, stillOwned func() bo return false, xerrors.Errorf("getting miner info: %w", err) } - a, _, err := s.as.AddressFor(ctx, s.api, mi, api.PreCommitAddr, collateral, big.Zero()) + a, _, err := s.as.AddressFor(ctx, s.api, maddr, mi, api.PreCommitAddr, collateral, big.Zero()) if err != nil { return false, xerrors.Errorf("getting address for precommit: %w", err) }