Merge pull request #600 from filecoin-project/feat/tests-also
Add --tests-also for fetch-params
This commit is contained in:
commit
d684300713
@ -29,7 +29,7 @@ commands:
|
||||
- 'v15-lotus-params-'
|
||||
paths:
|
||||
- /var/tmp/filecoin-proof-parameters/
|
||||
- run: ./lotus fetch-params
|
||||
- run: ./lotus fetch-params --include-test-params
|
||||
- save_cache:
|
||||
name: Save parameters cache
|
||||
key: 'v15-lotus-params-{{ checksum "build/proof-params/parameters.json" }}'
|
||||
|
@ -37,7 +37,7 @@ type fetch struct {
|
||||
errs []error
|
||||
}
|
||||
|
||||
func GetParams(storage bool) error {
|
||||
func GetParams(storage bool, tests bool) error {
|
||||
if err := os.Mkdir(paramdir, 0755); err != nil && !os.IsExist(err) {
|
||||
return err
|
||||
}
|
||||
@ -52,7 +52,7 @@ func GetParams(storage bool) error {
|
||||
ft := &fetch{}
|
||||
|
||||
for name, info := range params {
|
||||
if !SupportedSectorSize(info.SectorSize) {
|
||||
if !(SupportedSectorSize(info.SectorSize) || (tests && info.SectorSize == 1<<10)) {
|
||||
continue
|
||||
}
|
||||
if !storage && strings.HasSuffix(name, ".params") {
|
||||
|
@ -14,9 +14,14 @@ var fetchParamCmd = &cli.Command{
|
||||
Name: "only-verify-keys",
|
||||
Usage: "only download the verify keys",
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "include-test-params",
|
||||
Usage: "download params used for tests",
|
||||
},
|
||||
},
|
||||
Action: func(cctx *cli.Context) error {
|
||||
if err := build.GetParams(!cctx.Bool("only-verify-keys")); err != nil {
|
||||
err := build.GetParams(!cctx.Bool("only-verify-keys"), cctx.Bool("include-test-params"))
|
||||
if err != nil {
|
||||
return xerrors.Errorf("fetching proof parameters: %w", err)
|
||||
}
|
||||
|
||||
|
@ -59,7 +59,7 @@ var initCmd = &cli.Command{
|
||||
log.Info("Initializing lotus storage miner")
|
||||
|
||||
log.Info("Checking proof parameters")
|
||||
if err := build.GetParams(true); err != nil {
|
||||
if err := build.GetParams(true, false); err != nil {
|
||||
return xerrors.Errorf("fetching proof parameters: %w", err)
|
||||
}
|
||||
|
||||
|
@ -36,7 +36,7 @@ var runCmd = &cli.Command{
|
||||
},
|
||||
},
|
||||
Action: func(cctx *cli.Context) error {
|
||||
if err := build.GetParams(true); err != nil {
|
||||
if err := build.GetParams(true, false); err != nil {
|
||||
return xerrors.Errorf("fetching proof parameters: %w", err)
|
||||
}
|
||||
|
||||
|
@ -58,7 +58,7 @@ var DaemonCmd = &cli.Command{
|
||||
return err
|
||||
}
|
||||
|
||||
if err := build.GetParams(false); err != nil {
|
||||
if err := build.GetParams(false, false); err != nil {
|
||||
return xerrors.Errorf("fetching proof parameters: %w", err)
|
||||
}
|
||||
|
||||
|
2
go.sum
2
go.sum
@ -162,7 +162,6 @@ github.com/ipfs/go-car v0.0.2 h1:j02lzgeijorstzoMl3nQmvvb8wjJUVCiOAl8XEwYMCQ=
|
||||
github.com/ipfs/go-car v0.0.2/go.mod h1:60pzeu308k5kVFHzq0HIi2kPtITgor+1ll1xuGk5JwQ=
|
||||
github.com/ipfs/go-cid v0.0.1/go.mod h1:GHWU/WuQdMPmIosc4Yn1bcCT7dSeX4lBafM7iqUPQvM=
|
||||
github.com/ipfs/go-cid v0.0.2/go.mod h1:GHWU/WuQdMPmIosc4Yn1bcCT7dSeX4lBafM7iqUPQvM=
|
||||
github.com/ipfs/go-cid v0.0.3 h1:UIAh32wymBpStoe83YCzwVQQ5Oy/H0FdxvUS6DJDzms=
|
||||
github.com/ipfs/go-cid v0.0.3/go.mod h1:GHWU/WuQdMPmIosc4Yn1bcCT7dSeX4lBafM7iqUPQvM=
|
||||
github.com/ipfs/go-cid v0.0.4-0.20191112011718-79e75dffeb10 h1:5mRf2p8Bv2iKiuPsGrQUrx38rdBm2T/03JCM6VWzoMc=
|
||||
github.com/ipfs/go-cid v0.0.4-0.20191112011718-79e75dffeb10/go.mod h1:/BYOuUoxkE+0f6tGzlzMvycuN+5l35VOR4Bpg2sCmds=
|
||||
@ -432,7 +431,6 @@ github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1 h1:lYpkrQH5ajf0
|
||||
github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1/go.mod h1:pD8RvIylQ358TN4wwqatJ8rNavkEINozVn9DtGI3dfQ=
|
||||
github.com/minio/sha256-simd v0.0.0-20190131020904-2d45a736cd16/go.mod h1:2FMWW+8GMoPweT6+pI63m9YE3Lmw4J71hV56Chs1E/U=
|
||||
github.com/minio/sha256-simd v0.0.0-20190328051042-05b4dd3047e5/go.mod h1:2FMWW+8GMoPweT6+pI63m9YE3Lmw4J71hV56Chs1E/U=
|
||||
github.com/minio/sha256-simd v0.1.0 h1:U41/2erhAKcmSI14xh/ZTUdBPOzDOIfS93ibzUSl8KM=
|
||||
github.com/minio/sha256-simd v0.1.0/go.mod h1:2FMWW+8GMoPweT6+pI63m9YE3Lmw4J71hV56Chs1E/U=
|
||||
github.com/minio/sha256-simd v0.1.1-0.20190913151208-6de447530771 h1:MHkK1uRtFbVqvAgvWxafZe54+5uBxLluGylDiKgdhwo=
|
||||
github.com/minio/sha256-simd v0.1.1-0.20190913151208-6de447530771/go.mod h1:B5e1o+1/KgNmWrSQK08Y6Z1Vb5pwIktudl0J58iy0KM=
|
||||
|
@ -25,7 +25,7 @@ func TestSealAndVerify(t *testing.T) {
|
||||
|
||||
build.SectorSizes = []uint64{sectorSize}
|
||||
|
||||
if err := build.GetParams(true); err != nil {
|
||||
if err := build.GetParams(true, true); err != nil {
|
||||
t.Fatalf("%+v", err)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user