No description provided.
LevelDB Fixes and Enhancements #6904
pull ghost wants to merge 8 commits into bitcoin:master from jgarzik:2015_sqlite changing 7 files +267 −129-
ghost commented at 3:07 PM on October 29, 2015: none
-
dbwrapper: switch from leveldb to sqlite for bitcoind backend database 791e70fba7
-
dbwrapper: sqlite bug fixes 65f95b4234
-
dbwrapper: adjust db page size, cache size parameters 03765433af
-
dbwrapper: sqlite db init bug fixes, better errors 4d2e72900d
-
dbwrapper: improve sqlite comments, error diagnostics cbd5412a67
-
dbwrapper: enable write-ahead journalling (credit: wumpus) 0fdb5cebed
-
dbwrapper: enable sqlite WAL auto-checkpointing 0172e8d37b
-
dbwrapper: sqlite WAL auto checkpoint at 10,000 pages 159934199f
-
jonasschnelli commented at 3:44 PM on October 29, 2015: contributor
Would be nice to have a bench utility to compare this PR agains the leveldb version.
-
jgarzik commented at 4:07 PM on October 29, 2015: contributor
I intentionally avoided creating a pull request because we don't yet know if sqlite has adequate performance for our needs.
Based on preliminary @jmcorgan input, it sounds like sqlite is too slow.
Recommendation: Close pull request, but request @jmcorgan paste his test results here for issue tracking purposes.
- unknown closed this on Oct 29, 2015
- unknown reopened this on Oct 29, 2015
- unknown closed this on Oct 29, 2015
-
jmcorgan commented at 4:23 PM on October 29, 2015: contributor
My tests were entirely informal and subjective. We'd actually have to define a benchmark that could be part of an A/B test in order for the results to be interpreted.
-
dcousens commented at 8:02 PM on October 29, 2015: contributor
@LordOfTheCoin was this PR in working order such that the above could easily be tested?
-
ghost commented at 10:07 PM on October 29, 2015: none
Why not use http://www.aerospike.com ? Its insanely fast and opens up options for the future, ie. multi-threads in multiple processes.
-
ghost commented at 5:26 AM on October 30, 2015: none
Tried on Win 10, Compiled and Ran, Didn't Thoroughly Test Though
-
sipa commented at 6:44 AM on October 30, 2015: member
Also, running with -debug=bench will give a breakdown of time per activity.
-
ghost commented at 9:10 AM on October 30, 2015: none
BTW, AeroSpike doesn't have a c++ implementation
-
ghost commented at 10:37 AM on October 30, 2015: none
I think the client library doesnt exist in C++, but should easily support it.
Question is what our aim here is? Speed? Future in-ram processing ideas?
-
jgarzik commented at 1:00 PM on October 30, 2015: contributor
@LordOfTheCoin C++ works just fine with C libraries. @cryptomarc speed
-
ghost commented at 2:07 PM on October 30, 2015: none
To my understanding Aerospike pretty much kills in all the benchmark tests done vs other No-SQL db's. I will try to run a couple of tests myself and post them here.
-
sipa commented at 4:09 PM on October 30, 2015: member
Aerospike is AGPL...
-
ghost commented at 12:45 PM on October 31, 2015: none
Its' AGPL, compatable with GPL, but with MIT?
-
sipa commented at 3:14 PM on October 31, 2015: member
Using an AGPL library in Bitcoin Core would require Bitcoin Core itself to be licensed under AGPL or compatible terms.
Even if we would want to do that, it would be nearly impossible to accomplish. Every contributor in the past would need to give consent about this, as they hold copyright over the code they wrote.
-
ghost commented at 4:10 PM on October 31, 2015: none
There are about ~ 6000 Contributors, so I get it....
-
ghost commented at 5:23 PM on October 31, 2015: none
Its a shame, and something I missed out when looking at Aerospike. Shame because it seems to be much on par with some interesting functionality that we could utilize in the future for Bitcoin.
-
mcelrath commented at 5:26 PM on October 31, 2015: none
I really don't think this database should be or needs to be distributed with the core source (as leveldb currently is). There are no licensing issues when linking against an external library. This should be an external dependency, whose correctness can be verified using UTXO commitment hashes as I describe here: http://lists.linuxfoundation.org/pipermail/bitcoin-dev/2015-October/011638.html
-
sipa commented at 5:32 PM on October 31, 2015: member
Linking against a library is usually considered a derivative work, in particular when the library's .h file are under the same license.
Including the source code of our database engine inside the source tree or not is an artifact of using git subtrees. Even if we didn't, we would still need to specify an exact version to prevent bugfixes that break consensus by users who link against different versions. Using subtree or not is not relevant in this discussion.
UTXO commitments do not fix this, as they need a different trust model (miners not committing to incorrect data).
-
mcelrath commented at 5:45 PM on October 31, 2015: none
That's just not true regarding derivative works. Bitcoin links against e.g. boost and is not a derivative of boost. Its header files are distributed separately. It's easy to specify specific versions of external dependencies.
Verifying correctness of database operation is not a trust model change. I'm thinking of it mostly in an advisory capacity...to notify node operators that something has gone horribly wrong. Note that the UTXO commitment scheme I describe doesn't actually require those hashes to be committed to in a block. Nodes can locally compute them simply to verify their own correctness of operation (and not communicate them at all). So one has potentially 3 sources of these hashes: computed during block ingest, computed by database query, and committed in the block. Nodes that detect such an error could e.g. refuse to mine blocks (at the discretion of the operator -- obviously blindly trusting the hash in the block IS a trust model change).
-
sipa commented at 6:37 PM on October 31, 2015: member
@mcelrath In my understanding, Bitcoin binaries are a derivative work of the Boost headers, and if linked statically, a derivative work of the Boost C++ code too. If we were to make Bitcoin Core depend on an AGPL library, we could not distribute binaries without also providing the Bitcoin Core source code under AGPL-compatible licensing. If the AGPL library would be an optional dependency, things are potentially different - we could ship Bitcoin Core binaries that do not need the library for correct operation, but load them at runtime if available in that case.
- DrahtBot locked this on Sep 8, 2021