v1.27.0-a #10

Closed
jonathanface wants to merge 473 commits from v1.27.0-a into master
6 changed files with 41 additions and 14 deletions
Showing only changes of commit ce12cc05f7 - Show all commits

4
go.mod
View File

@ -12,6 +12,7 @@ require (
github.com/DataDog/zstd v1.4.5 github.com/DataDog/zstd v1.4.5
github.com/GeertJohan/go.rice v1.0.3 github.com/GeertJohan/go.rice v1.0.3
github.com/Gurpartap/async v0.0.0-20180927173644-4f7f499dd9ee github.com/Gurpartap/async v0.0.0-20180927173644-4f7f499dd9ee
github.com/KarpelesLab/reflink v1.0.1
github.com/Kubuxu/imtui v0.0.0-20210401140320-41663d68d0fa github.com/Kubuxu/imtui v0.0.0-20210401140320-41663d68d0fa
github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d
github.com/alecthomas/jsonschema v0.0.0-20200530073317-71f438968921 github.com/alecthomas/jsonschema v0.0.0-20200530073317-71f438968921
@ -37,6 +38,7 @@ require (
github.com/filecoin-project/go-bitfield v0.2.4 github.com/filecoin-project/go-bitfield v0.2.4
github.com/filecoin-project/go-cbor-util v0.0.1 github.com/filecoin-project/go-cbor-util v0.0.1
github.com/filecoin-project/go-commp-utils v0.1.3 github.com/filecoin-project/go-commp-utils v0.1.3
github.com/filecoin-project/go-commp-utils/nonffi v0.0.0-20220905160352-62059082a837
github.com/filecoin-project/go-crypto v0.0.1 github.com/filecoin-project/go-crypto v0.0.1
github.com/filecoin-project/go-data-transfer/v2 v2.0.0-rc7 github.com/filecoin-project/go-data-transfer/v2 v2.0.0-rc7
github.com/filecoin-project/go-fil-commcid v0.1.0 github.com/filecoin-project/go-fil-commcid v0.1.0
@ -168,7 +170,6 @@ require (
require ( require (
github.com/GeertJohan/go.incremental v1.0.0 // indirect github.com/GeertJohan/go.incremental v1.0.0 // indirect
github.com/KarpelesLab/reflink v1.0.1 // indirect
github.com/PuerkitoBio/purell v1.1.1 // indirect github.com/PuerkitoBio/purell v1.1.1 // indirect
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect
github.com/StackExchange/wmi v1.2.1 // indirect github.com/StackExchange/wmi v1.2.1 // indirect
@ -194,7 +195,6 @@ require (
github.com/etclabscore/go-jsonschema-walk v0.0.6 // indirect github.com/etclabscore/go-jsonschema-walk v0.0.6 // indirect
github.com/filecoin-project/go-amt-ipld/v2 v2.1.0 // indirect github.com/filecoin-project/go-amt-ipld/v2 v2.1.0 // indirect
github.com/filecoin-project/go-amt-ipld/v3 v3.1.0 // indirect github.com/filecoin-project/go-amt-ipld/v3 v3.1.0 // indirect
github.com/filecoin-project/go-commp-utils/nonffi v0.0.0-20220905160352-62059082a837 // indirect
github.com/filecoin-project/go-ds-versioning v0.1.2 // indirect github.com/filecoin-project/go-ds-versioning v0.1.2 // indirect
github.com/filecoin-project/go-hamt-ipld v0.1.5 // indirect github.com/filecoin-project/go-hamt-ipld v0.1.5 // indirect
github.com/filecoin-project/go-hamt-ipld/v2 v2.0.0 // indirect github.com/filecoin-project/go-hamt-ipld/v2 v2.0.0 // indirect

View File

@ -4,12 +4,11 @@ import (
"context" "context"
"encoding/json" "encoding/json"
"fmt" "fmt"
"github.com/KarpelesLab/reflink"
proof2 "github.com/filecoin-project/go-state-types/proof"
"io" "io"
"os" "os"
"path/filepath" "path/filepath"
"github.com/KarpelesLab/reflink"
"github.com/ipfs/go-cid" "github.com/ipfs/go-cid"
logging "github.com/ipfs/go-log/v2" logging "github.com/ipfs/go-log/v2"
"golang.org/x/xerrors" "golang.org/x/xerrors"
@ -17,6 +16,7 @@ import (
ffi "github.com/filecoin-project/filecoin-ffi" ffi "github.com/filecoin-project/filecoin-ffi"
commcid "github.com/filecoin-project/go-fil-commcid" commcid "github.com/filecoin-project/go-fil-commcid"
"github.com/filecoin-project/go-state-types/abi" "github.com/filecoin-project/go-state-types/abi"
proof2 "github.com/filecoin-project/go-state-types/proof"
"github.com/filecoin-project/lotus/provider/lpproof" "github.com/filecoin-project/lotus/provider/lpproof"
"github.com/filecoin-project/lotus/storage/paths" "github.com/filecoin-project/lotus/storage/paths"

View File

@ -1,7 +1,6 @@
package lpproof package lpproof
import ( import (
"github.com/filecoin-project/lotus/storage/sealer/fr32"
"io" "io"
"math/bits" "math/bits"
"os" "os"
@ -17,6 +16,8 @@ import (
commcid "github.com/filecoin-project/go-fil-commcid" commcid "github.com/filecoin-project/go-fil-commcid"
"github.com/filecoin-project/go-state-types/abi" "github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/lotus/storage/sealer/fr32"
) )
const nodeSize = 32 const nodeSize = 32

View File

@ -3,12 +3,12 @@ package lpseal
import ( import (
"bytes" "bytes"
"context" "context"
"github.com/filecoin-project/go-commp-utils/nonffi"
"github.com/ipfs/go-cid"
"github.com/ipfs/go-cid"
"golang.org/x/xerrors" "golang.org/x/xerrors"
"github.com/filecoin-project/go-address" "github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-commp-utils/nonffi"
"github.com/filecoin-project/go-commp-utils/zerocomm" "github.com/filecoin-project/go-commp-utils/zerocomm"
"github.com/filecoin-project/go-state-types/abi" "github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/go-state-types/crypto" "github.com/filecoin-project/go-state-types/crypto"
@ -81,7 +81,7 @@ func (s *SDRTask) Do(taskID harmonytask.TaskID, stillOwned func() bool) (done bo
err = s.db.Select(ctx, &pieces, ` err = s.db.Select(ctx, &pieces, `
SELECT piece_index, piece_cid, piece_size SELECT piece_index, piece_cid, piece_size
FROM sectors_sdr_initial_pieces FROM sectors_sdr_initial_pieces
WHERE sp_id = $1 AND sector_number = $2`, sectorParams.SpID, sectorParams.SectorNumber) WHERE sp_id = $1 AND sector_number = $2 ORDER BY piece_index asc`, sectorParams.SpID, sectorParams.SectorNumber)
if err != nil { if err != nil {
return false, xerrors.Errorf("getting pieces: %w", err) return false, xerrors.Errorf("getting pieces: %w", err)
} }

View File

@ -102,9 +102,35 @@ func (s *SubmitPrecommitTask) Do(taskID harmonytask.TaskID, stillOwned func() bo
SectorNumber: abi.SectorNumber(sectorParams.SectorNumber), SectorNumber: abi.SectorNumber(sectorParams.SectorNumber),
SealedCID: sealedCID, SealedCID: sealedCID,
SealRandEpoch: sectorParams.TicketEpoch, SealRandEpoch: sectorParams.TicketEpoch,
DealIDs: nil,
Expiration: expiration, Expiration: expiration,
}) })
{
var pieces []struct {
PieceIndex int64 `db:"piece_index"`
PieceCID string `db:"piece_cid"`
PieceSize int64 `db:"piece_size"`
F05DealID int64 `db:"f05_deal_id"`
}
err = s.db.Select(ctx, &pieces, `
SELECT piece_index, piece_cid, piece_size, f05_deal_id
FROM sectors_sdr_initial_pieces
WHERE sp_id = $1 AND sector_number = $2 ORDER BY piece_index asc`, sectorParams.SpID, sectorParams.SectorNumber)
if err != nil {
return false, xerrors.Errorf("getting pieces: %w", err)
}
if len(pieces) > 0 {
params.Sectors[0].UnsealedCid = &unsealedCID
for _, p := range pieces {
params.Sectors[0].DealIDs = append(params.Sectors[0].DealIDs, abi.DealID(p.F05DealID))
}
}
}
var pbuf bytes.Buffer var pbuf bytes.Buffer
if err := params.MarshalCBOR(&pbuf); err != nil { if err := params.MarshalCBOR(&pbuf); err != nil {
return false, xerrors.Errorf("serializing params: %w", err) return false, xerrors.Errorf("serializing params: %w", err)

View File

@ -2,22 +2,22 @@ package lpseal
import ( import (
"context" "context"
"github.com/filecoin-project/go-commp-utils/nonffi"
"github.com/filecoin-project/go-padreader"
"github.com/filecoin-project/lotus/storage/pipeline/lib/nullreader"
"github.com/ipfs/go-cid"
"io" "io"
"net/http" "net/http"
"github.com/ipfs/go-cid"
"golang.org/x/xerrors" "golang.org/x/xerrors"
"github.com/filecoin-project/go-commp-utils/nonffi"
"github.com/filecoin-project/go-commp-utils/zerocomm" "github.com/filecoin-project/go-commp-utils/zerocomm"
"github.com/filecoin-project/go-padreader"
"github.com/filecoin-project/go-state-types/abi" "github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/lotus/lib/harmony/harmonydb" "github.com/filecoin-project/lotus/lib/harmony/harmonydb"
"github.com/filecoin-project/lotus/lib/harmony/harmonytask" "github.com/filecoin-project/lotus/lib/harmony/harmonytask"
"github.com/filecoin-project/lotus/lib/harmony/resources" "github.com/filecoin-project/lotus/lib/harmony/resources"
"github.com/filecoin-project/lotus/provider/lpffi" "github.com/filecoin-project/lotus/provider/lpffi"
"github.com/filecoin-project/lotus/storage/pipeline/lib/nullreader"
"github.com/filecoin-project/lotus/storage/sealer/storiface" "github.com/filecoin-project/lotus/storage/sealer/storiface"
) )
@ -74,7 +74,7 @@ func (t *TreesTask) Do(taskID harmonytask.TaskID, stillOwned func() bool) (done
err = t.db.Select(ctx, &pieces, ` err = t.db.Select(ctx, &pieces, `
SELECT piece_index, piece_cid, piece_size, data_url, data_headers, data_raw_size SELECT piece_index, piece_cid, piece_size, data_url, data_headers, data_raw_size
FROM sectors_sdr_initial_pieces FROM sectors_sdr_initial_pieces
WHERE sp_id = $1 AND sector_number = $2`, sectorParams.SpID, sectorParams.SectorNumber) WHERE sp_id = $1 AND sector_number = $2 ORDER BY piece_index asc`, sectorParams.SpID, sectorParams.SectorNumber)
if err != nil { if err != nil {
return false, xerrors.Errorf("getting pieces: %w", err) return false, xerrors.Errorf("getting pieces: %w", err)
} }