Skip to content
This repository has been archived by the owner on Dec 19, 2022. It is now read-only.

Commit

Permalink
padreader for payload data (#157)
Browse files Browse the repository at this point in the history
  • Loading branch information
hunjixin authored and ta0li committed Jan 10, 2022
1 parent 44cc989 commit 96bdf47
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
5 changes: 2 additions & 3 deletions app/venus-sealer/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,8 @@ var initCmd = &cli.Command{
Usage: "indicate the deployment method of the venus-market, one of `solo`, `pool`, Default: `solo`",
},
&cli.StringFlag{
Name: "market-url",
Usage: "market url",
Required: true,
Name: "market-url",
Usage: "market url",
},
&cli.StringFlag{
Name: "market-token",
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ require (
github.com/filecoin-project/specs-actors/v6 v6.0.1
github.com/filecoin-project/specs-storage v0.1.1-0.20201105051918-5188d9774506
github.com/filecoin-project/venus v1.1.3-rc1
github.com/filecoin-project/venus-market v1.0.2-0.20211206084715-070874dc17eb
github.com/filecoin-project/venus-market v1.0.2-0.20211217074314-b0f03a224ab5
github.com/filecoin-project/venus-messager v1.2.2-rc1.0.20211201075617-c9dd295b905c
github.com/gbrlsnchs/jwt/v3 v3.0.0
github.com/golang/mock v1.6.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -389,8 +389,8 @@ github.com/filecoin-project/venus-auth v1.2.2-0.20210721103851-593a379c4916/go.m
github.com/filecoin-project/venus-auth v1.3.1-0.20210809053831-012d55d5f578/go.mod h1:/cbLZYvQhinVFUG4TP2Uy1o7LtF+guT21qZIMTmKk0g=
github.com/filecoin-project/venus-auth v1.3.1 h1:3FGPK6zCxZIpQA+VTY01wNaCvcgyLWPa61zuFY+br9c=
github.com/filecoin-project/venus-auth v1.3.1/go.mod h1:DZwxRN2SVvRjw4UOMw2PBO1+hwAusksaWJe6BoGkjec=
github.com/filecoin-project/venus-market v1.0.2-0.20211206084715-070874dc17eb h1:MNupB2v1fBye/Niq2dpN24UN+tztP6FJwpffq/6xFa8=
github.com/filecoin-project/venus-market v1.0.2-0.20211206084715-070874dc17eb/go.mod h1:yDx6bwthenirxF9TIWUAZ20cpySvw45ktBqY2yAmGYQ=
github.com/filecoin-project/venus-market v1.0.2-0.20211217074314-b0f03a224ab5 h1:8tS6dzNZgYjgzERHXgEtMcwcm+jrmriHZG0VBKG8Q7A=
github.com/filecoin-project/venus-market v1.0.2-0.20211217074314-b0f03a224ab5/go.mod h1:yDx6bwthenirxF9TIWUAZ20cpySvw45ktBqY2yAmGYQ=
github.com/filecoin-project/venus-messager v1.2.2-rc1.0.20211201075617-c9dd295b905c h1:eLyzMO+gCk/zmiajbk7BQTCD8lm85NpNPAHdWH3jtYM=
github.com/filecoin-project/venus-messager v1.2.2-rc1.0.20211201075617-c9dd295b905c/go.mod h1:6bIzQHF9SMavQWRwxntjAocxz95LUBuT2Q52Q8TkQ3c=
github.com/filecoin-project/venus-wallet v1.2.0/go.mod h1:RsBPnMOv0qqL1bwB4SdstSecIRF9WY1OZFE/0BshyrM=
Expand Down
10 changes: 8 additions & 2 deletions storage-sealing/deals.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package sealing

import (
"context"
"github.com/filecoin-project/go-padreader"

types2 "github.com/filecoin-project/venus-market/types"
"github.com/filecoin-project/venus-sealer/types"
Expand All @@ -19,13 +20,18 @@ func (m *Sealing) DealSector(ctx context.Context) ([]types.DealAssign, error) {

var assigned []types.DealAssign
for _, deal := range deals {
r, err := m.pieceStorage.Read(ctx, deal.PieceStorage)
r, err := m.pieceStorage.Read(ctx, deal.PieceCID.String())
if err != nil {
log.Errorf("read piece from piece storage %v", err)
continue
}

so, err := m.SectorAddPieceToAny(ctx, deal.Length.Unpadded(), r, types.PieceDealInfo{
padR, err := padreader.NewInflator(r, uint64(deal.PayloadSize), deal.PieceSize.Unpadded())
if err != nil {
return nil, err
}

so, err := m.SectorAddPieceToAny(ctx, deal.Length.Unpadded(), padR, types.PieceDealInfo{
PublishCid: &deal.PublishCid,
DealID: deal.DealID,
DealProposal: &deal.DealProposal,
Expand Down

0 comments on commit 96bdf47

Please sign in to comment.