Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Zerocoin][Validation] Cache checksum heights #938

Merged
merged 1 commit into from
May 3, 2021

Commits on May 2, 2021

  1. [Zerocoin][Validation] Cache checksum heights

    Validating zerocoin spends requires determining the height of an
    accumulator hash, which is done by searching through all the blocks
    in the chain starting from genesis, for every txin.
    
    Since the height of a particular hash-denomination pair is not going
    to change, we can cache it. This is most useful for in-wallet block
    template generation, since each mining thread performs these
    validations separately (while holding cs_main).
    
    Adds a SimpleLRUCache template based on 7c9e97a and uses it to
    store checksum heights. I chose a particular size for it that should
    be large enough for significant spends.
    
    This results in a roughly 30+x speedup of zerocoin spend validation
    (26-30ms/txin -> 0.4-0.9ms/txin). Vastly improves Veil-Project#862 alongside Veil-Project#915.
    Zannick committed May 2, 2021
    Configuration menu
    Copy the full SHA
    1235e1c View commit details
    Browse the repository at this point in the history