From 24b5d46d02cf4d9207ab5045625d6a339eb48672 Mon Sep 17 00:00:00 2001 From: "Masih H. Derkani" Date: Wed, 22 Jan 2025 09:57:53 +0000 Subject: [PATCH] Handle non-existing actors gracefully in F3 power proportion CLI When calculating proportional F3 participation power for a given actor IDs instead of failing when an actor isn't found, collect the non-existing ones and report them. This makes up a better UX when debugging F3 in cases where actors don't exist in the F3 power table. --- cli/f3.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cli/f3.go b/cli/f3.go index 966c6f3d681..a0ec775d622 100644 --- a/cli/f3.go +++ b/cli/f3.go @@ -228,6 +228,7 @@ var f3SubCmdPowerTable = &cli.Command{ } ScaledSum int64 Proportion float64 + NotFound []gpbft.ActorID }{ Instance: instance, FromEC: cctx.Bool(f3FlagPowerTableFromEC.Name), @@ -287,7 +288,8 @@ var f3SubCmdPowerTable = &cli.Command{ seenIDs[actorID] = struct{}{} scaled, key := pt.Get(actorID) if key == nil { - return fmt.Errorf("actor ID %d not found in power table", actorID) + result.NotFound = append(result.NotFound, actorID) + continue } result.ScaledSum += scaled }