From deb3491412682e38fa39775ebdadfdcb23e1a124 Mon Sep 17 00:00:00 2001 From: "Leo Zhang (zhangchiqing)" Date: Fri, 20 Dec 2024 10:39:45 -0800 Subject: [PATCH 1/4] log verification progress --- engine/verification/verifier/verifiers.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/engine/verification/verifier/verifiers.go b/engine/verification/verifier/verifiers.go index 7ccef14982f..62407852406 100644 --- a/engine/verification/verifier/verifiers.go +++ b/engine/verification/verifier/verifiers.go @@ -18,6 +18,7 @@ import ( "github.com/onflow/flow-go/module" "github.com/onflow/flow-go/module/chunks" "github.com/onflow/flow-go/module/metrics" + "github.com/onflow/flow-go/module/util" "github.com/onflow/flow-go/state/protocol" "github.com/onflow/flow-go/storage" storagepebble "github.com/onflow/flow-go/storage/pebble" @@ -125,6 +126,14 @@ func verifyConcurrently( var lowestErrHeight uint64 = ^uint64(0) // Initialize to max value of uint64 var mu sync.Mutex // To protect access to lowestErr and lowestErrHeight + lg := util.LogProgress( + log.Logger, + util.DefaultLogProgressConfig( + fmt.Sprintf("verifying heights progress for [%v:%v]", from, to), + int(to+1-from), + ), + ) + // Worker function worker := func() { for { @@ -154,6 +163,8 @@ func verifyConcurrently( } else { log.Info().Uint64("height", height).Msg("verified height successfully") } + + lg(1) // log progress } } } From d68e3757682253bcc276823a40567d67086a346a Mon Sep 17 00:00:00 2001 From: "Leo Zhang (zhangchiqing)" Date: Thu, 9 Jan 2025 11:22:45 -0800 Subject: [PATCH 2/4] fix error message --- cmd/util/cmd/verify_execution_result/cmd.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/util/cmd/verify_execution_result/cmd.go b/cmd/util/cmd/verify_execution_result/cmd.go index 9263773aa5b..d2423369879 100644 --- a/cmd/util/cmd/verify_execution_result/cmd.go +++ b/cmd/util/cmd/verify_execution_result/cmd.go @@ -95,7 +95,7 @@ func run(*cobra.Command, []string) { func parseFromTo(fromTo string) (from, to uint64, err error) { parts := strings.Split(fromTo, "-") if len(parts) != 2 { - return 0, 0, fmt.Errorf("invalid format: expected 'from-to', got '%s'", fromTo) + return 0, 0, fmt.Errorf("invalid format: expected 'from_to', got '%s'", fromTo) } from, err = strconv.ParseUint(strings.TrimSpace(parts[0]), 10, 64) From f7188ad854105e4c938ea31b48c9204fc81e9b3b Mon Sep 17 00:00:00 2001 From: "Leo Zhang (zhangchiqing)" Date: Thu, 9 Jan 2025 14:22:24 -0800 Subject: [PATCH 3/4] fix spliter --- cmd/util/cmd/verify_execution_result/cmd.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/util/cmd/verify_execution_result/cmd.go b/cmd/util/cmd/verify_execution_result/cmd.go index d2423369879..cb76a5e51d7 100644 --- a/cmd/util/cmd/verify_execution_result/cmd.go +++ b/cmd/util/cmd/verify_execution_result/cmd.go @@ -93,7 +93,7 @@ func run(*cobra.Command, []string) { } func parseFromTo(fromTo string) (from, to uint64, err error) { - parts := strings.Split(fromTo, "-") + parts := strings.Split(fromTo, "_") if len(parts) != 2 { return 0, 0, fmt.Errorf("invalid format: expected 'from_to', got '%s'", fromTo) } From cd5ae62dab9d11b1390bbbf747f6844eaeb912b2 Mon Sep 17 00:00:00 2001 From: "Leo Zhang (zhangchiqing)" Date: Mon, 13 Jan 2025 08:50:55 -0800 Subject: [PATCH 4/4] update comments --- cmd/util/cmd/verify_execution_result/cmd.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/util/cmd/verify_execution_result/cmd.go b/cmd/util/cmd/verify_execution_result/cmd.go index cb76a5e51d7..91ddd33ec0e 100644 --- a/cmd/util/cmd/verify_execution_result/cmd.go +++ b/cmd/util/cmd/verify_execution_result/cmd.go @@ -24,7 +24,7 @@ var ( // # verify the last 100 sealed blocks // ./util verify_execution_result --chain flow-testnet --datadir /var/flow/data/protocol --chunk_data_pack_dir /var/flow/data/chunk_data_pack --lastk 100 // # verify the blocks from height 2000 to 3000 -// ./util verify_execution_result --chain flow-testnet --datadir /var/flow/data/protocol --chunk_data_pack_dir /var/flow/data/chunk_data_pack --from_to 2000-3000 +// ./util verify_execution_result --chain flow-testnet --datadir /var/flow/data/protocol --chunk_data_pack_dir /var/flow/data/chunk_data_pack --from_to 2000_3000 var Cmd = &cobra.Command{ Use: "verify-execution-result", Short: "verify block execution by verifying all chunks in the result", @@ -47,7 +47,7 @@ func init() { "last k sealed blocks to verify") Cmd.Flags().StringVar(&flagFromTo, "from_to", "", - "the height range to verify blocks (inclusive), i.e, 1-1000, 1000-2000, 2000-3000, etc.") + "the height range to verify blocks (inclusive), i.e, 1_1000, 1000_2000, 2000_3000, etc.") Cmd.Flags().UintVar(&flagWorkerCount, "worker_count", 1, "number of workers to use for verification, default is 1")