ssv icon indicating copy to clipboard operation
ssv copied to clipboard

Use partial signature messages instead of decided in exporter

Open nkryuchkov opened this issue 10 months ago • 2 comments

The PR changes the exporter message handling logic to use partial signature messages instead of decided messages to gather information about consensus participants.

Since decided messages are not used anymore, the old API returning decided messages behaves a bit differently, constructing a "decided" message from information in the partial signature messages, but some fields are not available anymore, however, it's still compatible with the explorer, because it uses just a few fields. So, the old API is just a workaround for compatibility with the explorer.

There's also a new API that is simple/straightforward but requires changes to the explorer.

Examples of API:

Old

{"type":"decided","filter":{"from":1439466,"to":1439500,"role":"ATTESTER","publicKey":"aadcd9e473fa356a10dc14c876d1570d0f9affb39d479b317d39a93393d64b3608bb82220eb7011f659c5adc0275ac96"},"data":[{"Signature":null,"Signers":[29,30,31],"Message":{"MsgType":2,"Height":1439466,"Round":0,"Identifier":"AAAxEqrc2eRz+jVqENwUyHbRVw0Pmv+znUebMX05qTOT1ks2CLuCIg63AR9lnFrcAnWslgAAAAA=","Root":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"DataRound":0,"RoundChangeJustification":null,"PrepareJustification":null},"FullData":{"Duty":{"Type":0,"PubKey":"0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","Slot":"1439466","ValidatorIndex":"0","CommitteeIndex":0,"CommitteeLength":0,"CommitteesAtSlot":0,"ValidatorCommitteeIndex":0,"ValidatorSyncCommitteeIndices":null},"Version":"unknown","PreConsensusJustifications":null,"DataSSZ":null}}]}

New

{"type":"participants","filter":{"from":1439466,"to":1439500,"role":"ATTESTER","publicKey":"aadcd9e473fa356a10dc14c876d1570d0f9affb39d479b317d39a93393d64b3608bb82220eb7011f659c5adc0275ac96"},"data":[{"Signers":[29,30,31],"Slot":"1439466","Identifier":"AAAxEqrc2eRz+jVqENwUyHbRVw0Pmv+znUebMX05qTOT1ks2CLuCIg63AR9lnFrcAnWslgAAAAA=","ValidatorPK":"aadcd9e473fa356a10dc14c876d1570d0f9affb39d479b317d39a93393d64b3608bb82220eb7011f659c5adc0275ac96","Role":"ATTESTER"}]}

nkryuchkov avatar Apr 15 '24 09:04 nkryuchkov

Codecov Report

Attention: Patch coverage is 19.33333% with 121 lines in your changes are missing coverage. Please review.

Project coverage is 50.1%. Comparing base (4867647) to head (cf2bf33). Report is 1 commits behind head on stage.

Files Patch % Lines
exporter/api/query_handlers.go 7.5% 49 Missing :warning:
exporter/api/msg.go 24.4% 37 Missing :warning:
ibft/storage/store.go 26.6% 32 Missing and 1 partial :warning:
cli/operator/node.go 0.0% 1 Missing :warning:
operator/validator/controller.go 50.0% 1 Missing :warning:
Additional details and impacted files

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Apr 16 '24 11:04 codecov[bot]

The explorer team shared the fields they are using, so this PR needs to check whether all these fields are set in the old 'compatibiliy' API:

public key 
slot
role
version
network
round
height
signers
message_type 

nkryuchkov avatar May 20 '24 11:05 nkryuchkov

This was merged as part of #1409

y0sher avatar Jul 15 '24 14:07 y0sher