Reduce memory usage of CBlockIndex#49
Merged
DeckerSU merged 7 commits intostatic-experimentalfrom Apr 20, 2023
Merged
Conversation
Signed-off-by: Daira Hopwood <daira@jacaranda.org> # Conflicts: # qa/rpc-tests/test_framework/util.py # src/txdb.cpp
…as been written to the leveldb database. Co-authored-by: Jack Grigg <thestr4d@gmail.com> Signed-off-by: Daira Hopwood <daira@jacaranda.org> # Conflicts: # doc/release-notes.md # src/chain.h # src/main.cpp # src/rest.cpp # src/rpc/blockchain.cpp # src/txdb.h
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
…lly so. Signed-off-by: Daira Hopwood <daira@jacaranda.org> # Conflicts: # src/txdb.cpp # src/txdb.h
The const annotation was removed from the blockinfo type in zcash/zcash#6192, but not from the type of its iterator. Recent Clang versions are able to handle this, but GCC 11 (and it appears older Clang versions) raise an error. Closes zcash/zcash#6306.
# Conflicts: # src/txdb.cpp
This was referenced Mar 31, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR is a backport of zcash/zcash#6192 in our codebase:
The
nSolutionfield ofCBlockIndexholds astd::vector<unsigned char>containing a 1344-byte Equihash solution. In normal operation the node holds a linked tree of CBlockIndex nodes for the whole chain. Therefore, the total memory required for thesenSolutionfields for the current mainnet height 3358920, is at least3358920 * 1344 = 4514388480 bytes,~4.51 GiB.It has to be possible to retrieve the
nSolutionfield for any stored block in order to answer peergetheadersqueries, for example. But once a block index entry has been flushed to leveldb (which happens asynchronously), it is no longer necessary to keep this field in memory, because it can be read back if needed. The cost of this should be small because of the caching done by leveldb.Links:
With this PR old branch named
reduce-equihash-solution-memorycould be deleted.Todo: