Conversation
|
@0xmad why are we doing |
|
Because we want to distinguish how many private deposits left in the pool. Withdrawals can be calculated as well because they are not part of the pool anymore. |
| return { | ||
| shieldEth: getAverageMetrics(shieldEthReceipts), | ||
| unshieldEth: getAverageMetrics(unshieldEthReceipts), | ||
| anonymitySetSize: shieldEthReceipts.length - unshieldEthReceipts.length, |
There was a problem hiding this comment.
John:
@0xmad why are we doing shieldEthReceipts.length - unshieldEthReceipts.length for anonymity set size?
Anton:
Because we want to distinguish how many private deposits left in the pool. Withdrawals can be calculated as well because they are not part of the pool anymore.
So we actually want to get to total size of the anonymity set, not the size within a specific window. If we sample 5 weeks of blocks, we will get the net change within that window, but not the cumulative anonymity set size
There was a problem hiding this comment.
With current design, it’s not possible to fetch all the events and calculate total size of deposits.
There was a problem hiding this comment.
Yes definitely. So I think we could also try measure anonymity set over a time window, but our operation (shield, transfer, unshield) capturing logic only measures simple transfers for many protocols. So the "unspent" anonymity set window would not account for all relevant state updates. E.g we are measuring transfers with 1 input and 1 output, but not transfers with 1 input and 2 outputs.
This is either too complex to not be worthwhile, or requires something quite involved. I'm going to leave some notes in this issue
Add anonymity set size benchmark for all the gas benchmarked projects