Add --tests-also for fetch-params

License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
This commit is contained in:
Jakub Sztandera 2019-11-14 02:15:33 +01:00
parent 3e22712f2d
commit bc3dac0426
No known key found for this signature in database
GPG Key ID: 9A9AF56F8B3879BA
7 changed files with 12 additions and 9 deletions

View File

@ -29,7 +29,7 @@ commands:
- 'v15-lotus-params-' - 'v15-lotus-params-'
paths: paths:
- /var/tmp/filecoin-proof-parameters/ - /var/tmp/filecoin-proof-parameters/
- run: ./lotus fetch-params - run: ./lotus fetch-params --tests-also
- save_cache: - save_cache:
name: Save parameters cache name: Save parameters cache
key: 'v15-lotus-params-{{ checksum "build/proof-params/parameters.json" }}' key: 'v15-lotus-params-{{ checksum "build/proof-params/parameters.json" }}'

View File

@ -37,7 +37,7 @@ type fetch struct {
errs []error 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) { if err := os.Mkdir(paramdir, 0755); err != nil && !os.IsExist(err) {
return err return err
} }
@ -52,7 +52,7 @@ func GetParams(storage bool) error {
ft := &fetch{} ft := &fetch{}
for name, info := range params { for name, info := range params {
if !SupportedSectorSize(info.SectorSize) { if !(SupportedSectorSize(info.SectorSize) || (tests && info.SectorSize == 1<<10)) {
continue continue
} }
if !storage && strings.HasSuffix(name, ".params") { if !storage && strings.HasSuffix(name, ".params") {

View File

@ -14,9 +14,14 @@ var fetchParamCmd = &cli.Command{
Name: "only-verify-keys", Name: "only-verify-keys",
Usage: "only download the verify keys", Usage: "only download the verify keys",
}, },
&cli.BoolFlag{
Name: "tests-also",
Usage: "download params used for tests",
},
}, },
Action: func(cctx *cli.Context) error { 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("tests-also"))
if err != nil {
return xerrors.Errorf("fetching proof parameters: %w", err) return xerrors.Errorf("fetching proof parameters: %w", err)
} }

View File

@ -59,7 +59,7 @@ var initCmd = &cli.Command{
log.Info("Initializing lotus storage miner") log.Info("Initializing lotus storage miner")
log.Info("Checking proof parameters") 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) return xerrors.Errorf("fetching proof parameters: %w", err)
} }

View File

@ -36,7 +36,7 @@ var runCmd = &cli.Command{
}, },
}, },
Action: func(cctx *cli.Context) error { 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) return xerrors.Errorf("fetching proof parameters: %w", err)
} }

View File

@ -58,7 +58,7 @@ var DaemonCmd = &cli.Command{
return err 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) return xerrors.Errorf("fetching proof parameters: %w", err)
} }

2
go.sum
View File

@ -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-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.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.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.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 h1:5mRf2p8Bv2iKiuPsGrQUrx38rdBm2T/03JCM6VWzoMc=
github.com/ipfs/go-cid v0.0.4-0.20191112011718-79e75dffeb10/go.mod h1:/BYOuUoxkE+0f6tGzlzMvycuN+5l35VOR4Bpg2sCmds= 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/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-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.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.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 h1:MHkK1uRtFbVqvAgvWxafZe54+5uBxLluGylDiKgdhwo=
github.com/minio/sha256-simd v0.1.1-0.20190913151208-6de447530771/go.mod h1:B5e1o+1/KgNmWrSQK08Y6Z1Vb5pwIktudl0J58iy0KM= github.com/minio/sha256-simd v0.1.1-0.20190913151208-6de447530771/go.mod h1:B5e1o+1/KgNmWrSQK08Y6Z1Vb5pwIktudl0J58iy0KM=