From 5519b15d690275584a81b5a3a940220aba64ea9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Mon, 27 Nov 2023 23:36:29 +0100 Subject: [PATCH 1/2] feat: bench: flag to output GenerateWinningPoStWithVanilla params --- cmd/lotus-bench/simple.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/cmd/lotus-bench/simple.go b/cmd/lotus-bench/simple.go index 8341c4b5399..31fcdc4c37e 100644 --- a/cmd/lotus-bench/simple.go +++ b/cmd/lotus-bench/simple.go @@ -658,6 +658,10 @@ var simpleWinningPost = &cli.Command{ Usage: "pass miner address (only necessary if using existing sectorbuilder)", Value: "t01000", }, + &cli.BoolFlag{ + Name: "output-inputs", + Usage: "output inputs for winning post generation", + }, }, ArgsUsage: "[sealed] [cache] [comm R] [sector num]", Action: func(cctx *cli.Context) error { @@ -728,6 +732,17 @@ var simpleWinningPost = &cli.Command{ fmt.Printf("Vanilla %s (%s)\n", challenge.Sub(start), bps(sectorSize, 1, challenge.Sub(start))) fmt.Printf("Proof %s (%s)\n", end.Sub(challenge), bps(sectorSize, 1, end.Sub(challenge))) fmt.Println(base64.StdEncoding.EncodeToString(proof[0].ProofBytes)) + + if cctx.Bool("output-inputs") { + fmt.Println("GenerateWinningPoStWithVanilla info:") + + fmt.Printf(" wpt: %d\n", wpt) + fmt.Printf(" mid: %d\n", mid) + fmt.Printf(" rand: %x\n", rand) + fmt.Printf(" vp: %x\n", vp) + fmt.Printf(" proof: %x\n", proof) + } + return nil }, } From 7214abfa3f26bb1e29452cb27b07349b4de8ea10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Tue, 28 Nov 2023 11:24:10 +0100 Subject: [PATCH 2/2] bench: --show-inputs instead of --output-inputs --- cmd/lotus-bench/simple.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/lotus-bench/simple.go b/cmd/lotus-bench/simple.go index 31fcdc4c37e..09df220786d 100644 --- a/cmd/lotus-bench/simple.go +++ b/cmd/lotus-bench/simple.go @@ -659,7 +659,7 @@ var simpleWinningPost = &cli.Command{ Value: "t01000", }, &cli.BoolFlag{ - Name: "output-inputs", + Name: "show-inputs", Usage: "output inputs for winning post generation", }, }, @@ -733,7 +733,7 @@ var simpleWinningPost = &cli.Command{ fmt.Printf("Proof %s (%s)\n", end.Sub(challenge), bps(sectorSize, 1, end.Sub(challenge))) fmt.Println(base64.StdEncoding.EncodeToString(proof[0].ProofBytes)) - if cctx.Bool("output-inputs") { + if cctx.Bool("show-inputs") { fmt.Println("GenerateWinningPoStWithVanilla info:") fmt.Printf(" wpt: %d\n", wpt)