Skip to content

Commit e4b821d

Browse files
committed
remove ENV overrides, shorten opt name, only allow setting via cmake option (not envvar), update doc ref
1 parent e2d638f commit e4b821d

File tree

3 files changed

+45
-10
lines changed

3 files changed

+45
-10
lines changed

cmake/script/CoverageInclude.cmake.in

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,6 @@
22
# Distributed under the MIT software license, see the accompanying
33
# file COPYING or https://opensource.org/license/mit/.
44

5-
if(NOT DEFINED LCOV_OPTS)
6-
set(LCOV_OPTS "$ENV{LCOV_OPTS}")
7-
endif()
8-
if(NOT DEFINED GENHTML_OPTS)
9-
set(GENHTML_OPTS "$ENV{GENHTML_OPTS}")
10-
endif()
11-
125
if("@CMAKE_CXX_COMPILER_ID@" STREQUAL "Clang")
136
find_program(LLVM_COV_EXECUTABLE llvm-cov REQUIRED)
147
set(COV_TOOL "${LLVM_COV_EXECUTABLE} gcov")
@@ -31,8 +24,8 @@ separate_arguments(LCOV_OPTS)
3124
set(LCOV_COMMAND ${LCOV_EXECUTABLE} --gcov-tool ${CMAKE_CURRENT_LIST_DIR}/cov_tool_wrapper.sh ${LCOV_OPTS})
3225

3326
find_program(GENHTML_EXECUTABLE genhtml REQUIRED)
34-
separate_arguments(GENHTML_OPTS)
35-
set(GENHTML_COMMAND ${GENHTML_EXECUTABLE} --show-details ${GENHTML_OPTS})
27+
separate_arguments(HTML_OPTS)
28+
set(GENHTML_COMMAND ${GENHTML_EXECUTABLE} --show-details ${HTML_OPTS})
3629

3730
find_program(GREP_EXECUTABLE grep REQUIRED)
3831
find_program(AWK_EXECUTABLE awk REQUIRED)

doc/developer-notes.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,11 @@ cmake -DLCOV_OPTS="--rc branch_coverage=1" -P build/Coverage.cmake
509509
```
510510

511511
GENHTML_OPTS can be specified to provide options to genhtml, the program that generates the
512-
html report from lcov: `GENHTML_OPTS="--exclude boost"`.
512+
html report from lcov: `HTML_OPTS="--exclude boost"`.
513+
514+
```
515+
cmake -DHTML_OPTS="--exclude boost" -P build/Coverage.cmake
516+
```
513517

514518
To enable test parallelism:
515519
```

doc/leveldb.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
LevelDB overview
2+
=================
3+
4+
LevelDB is a fast, embeddable key–value storage library created at Google. It provides an ordered mapping from arbitrary byte-string keys to byte-string values, optimized for high write throughput and efficient range queries.
5+
6+
Why Bitcoin Knots uses LevelDB
7+
------------------------------
8+
Bitcoin Knots (like Bitcoin Core) embeds LevelDB to persist several on-disk databases, for example:
9+
- The chainstate (UTXO set) and block index metadata
10+
- Various indexes and caches used by optional components
11+
12+
LevelDB’s log-structured merge-tree (LSM) design offers:
13+
- High write performance with sequential disk access patterns
14+
- Background compaction for space and read amplification control
15+
- Forward/backward iteration and efficient prefix/range scans
16+
17+
Key characteristics
18+
-------------------
19+
- API: Put(key, value), Get(key), Delete(key); batched atomic writes via WriteBatch; consistent point-in-time Snapshots; forward/backward Iterators.
20+
- Ordering: Keys are stored in sorted order (default bytewise comparator; custom comparators supported).
21+
- Compression: Supports Snappy compression when available.
22+
- Embedding: Single-process library; there is no built-in client/server mode.
23+
24+
Limitations to be aware of
25+
--------------------------
26+
- Not a SQL or relational database; no secondary indexes or query language.
27+
- Single-process access to a given database path at a time.
28+
- Behavior and performance can be sensitive to filesystem and OS parameters (e.g., open file limits).
29+
30+
Project references and further reading
31+
--------------------------------------
32+
- Upstream LevelDB documentation: src/leveldb/README.md (bundled) and https://github.com/google/leveldb/blob/master/doc/index.md
33+
- Bitcoin developer notes on "Upgrading LevelDB": doc/developer-notes.md#upgrading-leveldb — important considerations for compatibility, file descriptor usage, and consensus safety when changing LevelDB versions.
34+
35+
Notes for contributors
36+
----------------------
37+
- Any upgrades to the embedded LevelDB subtree must follow the guidance in the developer notes to avoid consensus-affecting changes and resource limit issues.
38+
- CRC32C acceleration used by LevelDB is provided via src/crc32c; see developer notes for details.

0 commit comments

Comments
 (0)