MyHush / hush3

Hush: Speak And Transact Freely
https://myhush.org
Other
15 stars 13 forks source link

Nullifier count too small in getchaintxstats #78

Closed leto closed 4 years ago

leto commented 4 years ago

"nullifiers": 330,

https://explorer.myhush.org/api/getchaintxtstats

To clarify, at one point Hush had over 18,000 nullifiers which seemed to be the global set at the time. Incidentally, we had no checkpoints other than the genesis block at this time.

leto commented 4 years ago
NullifierCount:mapTxSaplingNullifers.size=314
NullifierCount:mempool.getNullifiers.size=0
NullifierCount:cacheSaplingNullifiers.size=29

The first line used to show a global nullifier count but now it seems it does not, that is causing this issue.

leto commented 4 years ago

The above comment is incorrect, we use cacheSaplingNullifiers and that seems like it used to be a global cache but is no longer

leto commented 4 years ago

The last time this worked Hush had no recent checkpoints defined and then I added proper checkpoints. This bug may be related to these data structures only keeping data since the last checkpointed block.

We may just want to calculate and store this data ourselves rather than relying on 3 other data structures that don't seem to do what we want.

leto commented 4 years ago

We now keep track of all shielded spends in every tx and every block, and do not rely on this value for any calculations. The internal data structures originally used were never meant to be used that way.