From 364cc7675a4b81efa61867c080659854e0fa125b Mon Sep 17 00:00:00 2001 From: "Masih H. Derkani" Date: Wed, 22 Jan 2025 10:46:17 +0000 Subject: [PATCH] feat: handle non-existing actors gracefully in F3 power proportion CLI (#12840) 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 966c6f3d68..a0ec775d62 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 }