validation: Persist coins cache to disk and load on startup #18936

pull andrewtoth wants to merge 1 commits into bitcoin:master from andrewtoth:persist-coinscache changing 4 files +126 −0
  1. andrewtoth commented at 5:06 pm on May 10, 2020: contributor

    This PR adds a way to persist the coins cache on shutdown to a file named coinscache.dat, similar to what is done for the mempool. On startup this file is used to warm the cache so it doesn’t get cold between restarts.

    This introduces a new config arg, -persistcoinscache, that is defaulted to true unless -dbcache is set to a higher value than default.

    With a higher cache value the amount of disk space used for the file could be very large and the warm up could take an excessively long time, so it defaults to off to prevent any footguns. With a max dbcache after a reindex or IBD it will dump the entire utxo set and load it into memory on startup. Testing this today I had a file size of 2.4GB and it took ~22 minutes to warm the cache with an SSD.

    After #17487 we can add a change to not wipe the cache on periodic flushes. We could then run the node continuously with the entire utxo set in memory. This could be useful for users who want to connect blocks quickly.

    I’m not sure how I should write tests for this.

  2. DrahtBot added the label UTXO Db and Indexes on May 10, 2020
  3. DrahtBot added the label Validation on May 10, 2020
  4. DrahtBot commented at 9:34 pm on May 10, 2020: member

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #18637 (coins: allow cache resize after init by jamesob)
    • #10443 (Add fee_est tool for debugging fee estimation code by ryanofsky)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

  5. Persist coins cache to disk and load on startup fee5962117
  6. andrewtoth force-pushed on May 11, 2020
  7. andrewtoth closed this on May 11, 2020

  8. DrahtBot locked this on Feb 15, 2022

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-10-31 03:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me