Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,3 @@ indent_size = 4
# .cirrus.yml, .fuzzbuzz.yml, etc.
[*.yml]
indent_size = 2

# Makefiles
[{*.am,Makefile.*.include}]
indent_style = tab

# Autoconf scripts
[configure.ac]
indent_size = 2
2 changes: 1 addition & 1 deletion .github/workflows/build-depends.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ jobs:
DEP_HASH="$(echo -n "${BUILD_TARGET}" "${DEP_OPTS}" "${HOST}" | sha256sum | head -c 64)"
echo "DEP_HASH=${DEP_HASH}" >> "${GITHUB_OUTPUT}"
DOCKERFILE_HASH="${{ hashFiles('contrib/containers/ci/ci.Dockerfile', 'contrib/containers/ci/ci-slim.Dockerfile') }}"
DEPENDS_INPUTS_HASH="${{ hashFiles('depends/Makefile', 'depends/funcs.mk', 'depends/gen_id', 'depends/config.guess', 'depends/config.sub', 'depends/config.site.in', 'depends/builders/**', 'depends/hosts/**', 'depends/packages/**', 'depends/patches/**') }}"
DEPENDS_INPUTS_HASH="${{ hashFiles('depends/Makefile', 'depends/funcs.mk', 'depends/gen_id', 'depends/config.guess', 'depends/config.sub', 'depends/toolchain.cmake.in', 'depends/builders/**', 'depends/hosts/**', 'depends/packages/**', 'depends/patches/**') }}"
CACHE_KEY_PREFIX="depends-${DOCKERFILE_HASH}-${BASE_IMAGE_DIGEST}-${RUNS_ON}-${BUILD_TARGET}"
CACHE_KEY="${CACHE_KEY_PREFIX}-${DEP_HASH}-${DEPENDS_INPUTS_HASH}"
echo "cache-key-prefix=${CACHE_KEY_PREFIX}" >> "${GITHUB_OUTPUT}"
Expand Down
145 changes: 4 additions & 141 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,167 +3,30 @@
todo.txt
reset-files.bash

*.tar.gz
# Build subdirectories.
/*build*

*.exe
src/dash
src/dashd
src/dash-cli
src/dash-gui
src/dash-node
src/dash-tx
src/dash-util
src/dash-chainstate
src/dash-wallet
src/test/fuzz/fuzz
src/test/test_dash
src/dashbls/runtest
src/qt/test/test_dash-qt
src/qt/res/css/colors/*
src/bench/bench_dash

# autoreconf
Makefile.in
aclocal.m4
autom4te.cache/
build-aux/config.guess
build-aux/config.sub
build-aux/depcomp
build-aux/install-sh
build-aux/ltmain.sh
build-aux/m4/libtool.m4
build-aux/m4/lt~obsolete.m4
build-aux/m4/ltoptions.m4
build-aux/m4/ltsugar.m4
build-aux/m4/ltversion.m4
build-aux/missing
build-aux/compile
build-aux/test-driver
config.cache
config.log
config.status
config.status.old
configure
libtool
src/config/bitcoin-config.h
src/config/bitcoin-config.h.in
src/config/stamp-h1
src/obj
share/setup.nsi
share/qt/Info.plist

src/qt/*.moc
src/qt/moc_*.cpp
src/qt/forms/ui_*.h

src/qt/test/moc*.cpp
libconftest.dylib*

.deps
.dirstamp
.libs
.*.swp
*~
*.bak
*.rej
*.orig
*.pyc
*.o
*.o-*
*.a
*.pb.cc
*.pb.h
*.dat

*.log
*.trs
*.zip

*.json.h
*.raw.h

# Only ignore unexpected patches
*.patch
!contrib/guix/patches/*.patch
!depends/patches/**/*.patch

#libtool object files
*.lo
*.la

# Compilation and Qt preprocessor part
*.qm
Makefile
!depends/Makefile
dash-qt
Dash-Qt.app

# Qt Creator
Makefile.am.user

# Unit-tests
Makefile.test
dash-qt_test

# Resources cpp
qrc_*.cpp

# Mac specific
.DS_Store
build
*.dSYM
/CMakeUserPresets.json

# Previous releases
releases

#lcov
*.gcno
*.gcda
/*.info
test_dash.coverage/
total.coverage/
fuzz.coverage/
coverage_percent.txt
/cov_tool_wrapper.sh
qa-assets/

#build tests
linux-coverage-build
linux-build
win32-build
test/config.ini
test/cache/*
test/.mypy_cache/

!src/leveldb*/Makefile
/releases

.cproject
.project
.autotools
/doc/doxygen/

libdashconsensus.pc
contrib/devtools/split-debug.sh
src/qt/dash-qt.bash
qa/pull-tester/tests-config.sh

#development symlinks
dash-cli
dashd
dash-qt
make

/contrib/containers/deploy/bin

# CLion
.idea
cmake-build-debug

# clang-check
*.plist

dist/

/guix-build-*

/ci/scratch/
Expand Down
55 changes: 25 additions & 30 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Short version, in order of preference:
be": a violation means someone has a bug worth investigating, but execution
stays well-defined. A negative rate-limit counter is the archetype - somebody
decremented twice, we may be more DoS-exposed than intended, but nothing is
corrupt. It aborts in `--enable-debug` and `--enable-fuzz` builds (CI's
corrupt. It aborts in `Debug` and `BUILD_FOR_FUZZING=ON` builds (CI's
`linux64_multiprocess` and fuzz jobs) while a failure is silent in release,
so it must never take down a production node. The expression is always
evaluated.
Expand Down Expand Up @@ -88,40 +88,35 @@ Use portable parallelism in examples. Linux-only CPU-count helpers are not
available on every supported developer host.

```bash
./autogen.sh

JOBS="$(getconf _NPROCESSORS_ONLN 2>/dev/null || sysctl -n hw.ncpu)"
JOBS="$(( JOBS > 1 ? JOBS - 1 : 1 ))"

make -C depends -j"$JOBS"

# Use the depends prefix printed for your platform, for example
# depends/x86_64-pc-linux-gnu or depends/aarch64-apple-darwin24.3.0.
./configure --prefix="$(pwd)/depends/[platform-triplet]"

make -j"$JOBS"
# Use the toolchain generated for your platform, for example
# depends/x86_64-pc-linux-gnu/toolchain.cmake.
cmake -B build --toolchain depends/[platform-triplet]/toolchain.cmake
cmake --build build -j"$JOBS"
```

Useful developer configure flags:
Useful developer configuration options:

```bash
./configure --prefix="$(pwd)/depends/[platform-triplet]" \
--disable-hardening \
--enable-crash-hooks \
--enable-debug \
--enable-reduce-exports \
--enable-stacktraces \
--enable-suppress-external-warnings \
--enable-werror
cmake -B build --toolchain depends/[platform-triplet]/toolchain.cmake \
-DENABLE_HARDENING=OFF \
-DENABLE_CRASH_HOOKS=ON \
-DCMAKE_BUILD_TYPE=Debug \
-DREDUCE_EXPORTS=ON \
-DENABLE_STACKTRACES=ON \
-DWERROR=ON
```

To generate `compile_commands.json` or run clang-tidy, see
`doc/developer-notes.md` under "Running clang-tidy".

When adding, removing, or renaming C++ source files, update the build system in
the same change. Most source/test files need `src/Makefile.am` or
`src/Makefile.test.include` updates, and new Dash-specific files must also be
appended to `test/util/data/non-backported.txt`.
the same change. Update the relevant `CMakeLists.txt`, and new Dash-specific
files must also be appended to `test/util/data/non-backported.txt`.

## Writing Tests

Expand All @@ -141,20 +136,20 @@ Choose tests based on the files touched.

```bash
# All unit tests
make check
ctest --test-dir build

# One Boost test suite or case
./src/test/test_dash --run_test=getarg_tests
./build/src/test/test_dash --run_test=getarg_tests

# All functional tests
test/functional/test_runner.py
build/test/functional/test_runner.py

# One functional test
test/functional/test_runner.py wallet_hd.py
build/test/functional/test_runner.py wallet_hd.py

# Parallel functional tests
JOBS="$(getconf _NPROCESSORS_ONLN 2>/dev/null || sysctl -n hw.ncpu)"
test/functional/test_runner.py -j"$JOBS"
build/test/functional/test_runner.py -j"$JOBS"

# Lint
test/lint/all-lint.py
Expand Down Expand Up @@ -271,19 +266,19 @@ Be extra careful around:

```bash
# Run dashd with broad logging
./src/dashd -debug=all -printtoconsole
./build/src/dashd -debug=all -printtoconsole

# Run a functional test against a custom binary
test/functional/test_runner.py --dashd=/path/to/dashd wallet_hd.py
build/test/functional/test_runner.py --dashd=/path/to/dashd wallet_hd.py

# Keep failed functional-test datadirs
test/functional/test_runner.py --nocleanup --tracerpc -l DEBUG wallet_hd.py
build/test/functional/test_runner.py --nocleanup --tracerpc -l DEBUG wallet_hd.py

# Debug a unit-test binary
gdb ./src/test/test_dash
gdb ./build/src/test/test_dash

# Profile a functional test
test/functional/test_runner.py --perf wallet_hd.py
build/test/functional/test_runner.py --perf wallet_hd.py
perf report -i /path/to/datadir/test.perf.data --stdio | c++filt
```

Expand Down
Loading
Loading