CodeChain-io/codechain-indexer

Check CCCChanges

majecty opened this issue · 3 comments

Calculating validator rewards in Dynamic Validator is complicated. We need to check that the calculation results are correct.

We can check the correctness by the method below.
Ask CodeChain for the balance between block n and block n-1 and compare it to the sum of the CCCChanges in block n. These two values must be the same.

@joojis

I want to make the indexer start a loop that checks the CCCChanges when the environment variable "CHECK_CCC_CHANGES" is given. What do you think about it?

@majecty I think that's something good to have. We can enable the feature in development/test purpose server so that we can avoid slow indexing issue.

Implemented in the #277.