From @dmitrystas 's comment https://github.com/input-output-hk/cardano-db-sync/issues/415#issuecomment-755156671 .
Specifically the pool profitability calculation should not be affected by the possibility that some stake addresses that delegated to the pool may not be valid (and hence rewards to that invalid stake address got back to the reserves).
Maybe an orphaned_rewards
table is the best solution. Will keep that in mind when implementing the fix for #415 .
Another way to represent it might be to keep it in the rewards
table but make the addr_id
field NULLABLE
and use a NULL
in that column to indicate that there is no valid address in that column. Alternatively, there could be another boolean
column indicating whether the reward could be distributed.
Open to feedback on how this should be handled.
PR #469 adds an OrphanReward
table and splits the rewards retrieved from ledger state into either the Reward
or OrphanReward
tables depending on whether the stake address is valid or invalid.
Most helpful comment
Another way to represent it might be to keep it in the
rewards
table but make theaddr_id
fieldNULLABLE
and use aNULL
in that column to indicate that there is no valid address in that column. Alternatively, there could be anotherboolean
column indicating whether the reward could be distributed.Open to feedback on how this should be handled.