From cdc535394dd336fbc4c8d771a3ea5135fe82a98d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Wed, 7 Aug 2019 01:17:41 +0200 Subject: [PATCH] deals: fix statestore --- chain/deals/handler.go | 2 ++ chain/deals/state_store.go | 7 ++++--- cmd/lotus-storage-miner/main.go | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/chain/deals/handler.go b/chain/deals/handler.go index 9e94d527c..a871cdb84 100644 --- a/chain/deals/handler.go +++ b/chain/deals/handler.go @@ -93,6 +93,7 @@ func (h *Handler) Run(ctx context.Context) { } go func(id cid.Cid) { + log.Info("fetching data for a deal") err := merkledag.FetchGraph(ctx, deal.Ref, h.dag) if err != nil { return @@ -102,6 +103,7 @@ func (h *Handler) Run(ctx context.Context) { case fetched <- id: case <-h.stop: } + log.Info("Fetched!") }(deal.ProposalCid) case id := <-fetched: // TODO: send response if client still there diff --git a/chain/deals/state_store.go b/chain/deals/state_store.go index 89625ee00..93e13b53b 100644 --- a/chain/deals/state_store.go +++ b/chain/deals/state_store.go @@ -18,7 +18,8 @@ func (st *StateStore) Begin(i cid.Cid, s interface{}) error { return err } if has { - return xerrors.Errorf("Already tracking state for %s", i) + // TODO: uncomment after deals work + //return xerrors.Errorf("Already tracking state for %s", i) } b, err := cbor.DumpObject(s) if err != nil { @@ -49,7 +50,7 @@ func (st *StateStore) MutateMiner(i cid.Cid, mutator func(MinerDeal) (MinerDeal, func minerMutator(m func(MinerDeal) (MinerDeal, error)) func([]byte) ([]byte, error) { return func(in []byte) ([]byte, error) { var cur MinerDeal - err := cbor.DecodeInto(in, cur) + err := cbor.DecodeInto(in, &cur) if err != nil { return nil, err } @@ -70,7 +71,7 @@ func (st *StateStore) MutateClient(i cid.Cid, mutator func(ClientDeal) (ClientDe func clientMutator(m func(ClientDeal) (ClientDeal, error)) func([]byte) ([]byte, error) { return func(in []byte) ([]byte, error) { var cur ClientDeal - err := cbor.DecodeInto(in, cur) + err := cbor.DecodeInto(in, &cur) if err != nil { return nil, err } diff --git a/cmd/lotus-storage-miner/main.go b/cmd/lotus-storage-miner/main.go index 6c1aa4946..d91745783 100644 --- a/cmd/lotus-storage-miner/main.go +++ b/cmd/lotus-storage-miner/main.go @@ -17,7 +17,7 @@ var log = logging.Logger("main") const FlagStorageRepo = "storagerepo" func main() { - logging.SetLogLevel("*", "DEBUG") + logging.SetLogLevel("*", "INFO") local := []*cli.Command{ runCmd, initCmd,