stacks-core icon indicating copy to clipboard operation
stacks-core copied to clipboard

Add a means to easily check if an external signer is signing blocks as expected

Open jferrant opened this issue 1 year ago • 1 comments

There are plans to add metrics to the dashboard concerning how many blocks were signed in a given reward cycle by a signer.

Create an RPC endpoint that reports the number of blocks signed by a given public key for perhaps a given reward cycle. Would involve introducing a table of signer public keys with reward cycle and number of blocks signed. As each block is processed, read the vector of signatures, and update the table accordingly.

jferrant avatar Aug 22 '24 19:08 jferrant

To implement this, we would need to:

  • Create a table in the chainstate DB with rows of (public key, reward cycle ID, signature count)
  • Each time we process a Nakamoto block, check the signatures in its header and update the signer's (public key, reward cycle ID, signature count) row.
  • Add an RPC endpoint that takes a reward cycle and public key as input, and returns the signature count

The table can be populated lazily -- i.e. the absence of a row for the given key and reward cycle can be treated the same as a row in which the signature count is zero.

jcnelson avatar Aug 28 '24 15:08 jcnelson

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

blockstack-devops avatar Oct 25 '24 00:10 blockstack-devops