Open kelemeno opened 1 year ago
In fact, there is no efficient algorithm that can calculate reputation onchain. The way to calculate reputation is to find an order of nodes offchain, and pass that as an array into the smart contract. Then it can calculate reputation one-by-one for all people, as it can make sure when it calculates the order for any person that the previous people have already been calculated (or they don't exist.)
Current plan: add dynamic reputation recalculation at the bottom of the tree, and locked recalculation above it. (dynamic recalculation can still work for small number of recDagVote recipients at the bottom)
Whenever a voter registers, we can mark MRRD higher relative roots to be in the locked mode.
when calculating reputation for all people, it cannot be recursive, it has to be bottom up. (we don't just need the children, we need everything below a node)