From 3de919b6a06efbd54a754ae656ade35b4e32233d Mon Sep 17 00:00:00 2001 From: Nikita Kryuchkov Date: Thu, 17 Oct 2024 16:40:23 +0400 Subject: [PATCH] exporter: add pubkey to FullData on API response (#1782) --- exporter/api/msg.go | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/exporter/api/msg.go b/exporter/api/msg.go index de35f7371e..dc3ef2234a 100644 --- a/exporter/api/msg.go +++ b/exporter/api/msg.go @@ -63,11 +63,15 @@ func ParticipantsAPIData(msgs ...qbftstorage.ParticipantsRangeEntry) (interface{ apiMsgs := make([]*ParticipantsAPI, 0) for _, msg := range msgs { + dutyExecutorID := msg.Identifier.GetDutyExecutorID() + blsPubKey := phase0.BLSPubKey{} + copy(blsPubKey[:], dutyExecutorID) + apiMsg := &ParticipantsAPI{ Signers: msg.Signers, Slot: msg.Slot, Identifier: msg.Identifier[:], - ValidatorPK: hex.EncodeToString(msg.Identifier.GetDutyExecutorID()), + ValidatorPK: hex.EncodeToString(dutyExecutorID), Role: msg.Identifier.GetRoleType().String(), Message: specqbft.Message{ MsgType: specqbft.CommitMsgType, @@ -75,7 +79,12 @@ func ParticipantsAPIData(msgs ...qbftstorage.ParticipantsRangeEntry) (interface{ Identifier: msg.Identifier[:], Round: specqbft.FirstRound, }, - FullData: &spectypes.ValidatorConsensusData{Duty: spectypes.ValidatorDuty{Slot: msg.Slot}}, + FullData: &spectypes.ValidatorConsensusData{ + Duty: spectypes.ValidatorDuty{ + PubKey: blsPubKey, + Slot: msg.Slot, + }, + }, } apiMsgs = append(apiMsgs, apiMsg)