diff --git a/Makefile b/Makefile new file mode 100644 index 000000000..cc33cc2ca --- /dev/null +++ b/Makefile @@ -0,0 +1,7 @@ +SHELL = /bin/bash + +.DEFAULT_GOAL := download-proofs + +download-proofs: + go run github.com/filecoin-project/go-paramfetch/paramfetch 2048 ./docker-images/proof-parameters.json +.PHONY: download-proofs \ No newline at end of file diff --git a/lotus-soup/main.go b/lotus-soup/main.go index 9947ef24f..17e2828b3 100644 --- a/lotus-soup/main.go +++ b/lotus-soup/main.go @@ -14,31 +14,9 @@ var cases = map[string]interface{}{ "paych-stress": testkit.WrapTestEnvironment(paych.Stress), } -func init() { - build.BlockDelaySecs = 2 - build.PropagationDelaySecs = 4 - - _ = logging.SetLogLevel("*", "WARN") - _ = logging.SetLogLevel("dht/RtRefreshManager", "ERROR") // noisy - _ = logging.SetLogLevel("bitswap", "ERROR") // noisy - - _ = os.Setenv("BELLMAN_NO_GPU", "1") - - build.InsecurePoStValidation = true - build.DisableBuiltinAssets = true - - // MessageConfidence is the amount of tipsets we wait after a message is - // mined, e.g. payment channel creation, to be considered committed. - build.MessageConfidence = 1 - - power.ConsensusMinerMinPower = big.NewInt(2048) - miner.SupportedProofTypes = map[abi.RegisteredSealProof]struct{}{ - abi.RegisteredSealProof_StackedDrg2KiBV1: {}, - } - verifreg.MinVerifiedDealSize = big.NewInt(256) - -} - func main() { + sanityCheck() + run.InvokeMap(cases) } + diff --git a/lotus-soup/sanity.go b/lotus-soup/sanity.go new file mode 100644 index 000000000..b06a653c5 --- /dev/null +++ b/lotus-soup/sanity.go @@ -0,0 +1,35 @@ +package main + +import ( + "fmt" + "io/ioutil" + "os" +) + +func sanityCheck() { + enhanceMsg := func(msg string, a ...interface{}) string { + return fmt.Sprintf("sanity check: "+msg+"; if running on local:exec, make sure to run `make` from the root of the oni repo", a...) + } + + dir := "/var/tmp/filecoin-proof-parameters" + stat, err := os.Stat(dir) + if os.IsNotExist(err) { + panic(enhanceMsg("proofs parameters not available in /var/tmp/filecoin-proof-parameters")) + } + if err != nil { + panic(enhanceMsg("failed to stat /var/tmp/filecoin-proof-parameters: %s", err)) + } + + if !stat.IsDir() { + panic(enhanceMsg("/var/tmp/filecoin-proof-parameters is not a directory; aborting")) + } + + files, err := ioutil.ReadDir(dir) + if err != nil { + panic(enhanceMsg("failed list directory /var/tmp/filecoin-proof-parameters: %s", err)) + } + + if len(files) == 0 { + panic(enhanceMsg("no files in /var/tmp/filecoin-proof-parameters")) + } +}