diff --git a/.github/workflows/bsd.yml b/.github/workflows/bsd.yml index e2db5b4dfb66..f73348a7f04a 100644 --- a/.github/workflows/bsd.yml +++ b/.github/workflows/bsd.yml @@ -68,7 +68,7 @@ jobs: git config --global --add safe.directory `pwd` git submodule update --init --recursive - ./configure CC="$CC" --enable-developer --disable-valgrind + ./configure CC="$CC" --disable-valgrind cat config.vars diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 87b36e68c74b..9afb84c1d9eb 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -72,21 +72,14 @@ jobs: fail-fast: true matrix: include: - - CFG: gcc-dev1 - DEVELOPER: 1 - VALGRIND: 1 - COMPILER: gcc - - CFG: gcc-dev0 - DEVELOPER: 0 + - CFG: compile-gcc VALGRIND: 1 COMPILER: gcc # While we're at it let's try to compile with clang - - CFG: clang-dev1 - DEVELOPER: 1 + - CFG: compile-clang VALGRIND: 1 COMPILER: clang - - CFG: clang-sanitizers - DEVELOPER: 1 + - CFG: compile-clang-sanitizers COMPILER: clang ASAN: 1 UBSAN: 1 @@ -106,7 +99,6 @@ jobs: - name: Build env: - DEVELOPER: ${{ matrix.DEVELOPER }} COMPILER: ${{ matrix.COMPILER }} ASAN: ${{ matrix.ASAN }} UBSAN: ${{ matrix.UBSAN }} @@ -145,7 +137,7 @@ jobs: fail-fast: true matrix: include: - - CFG: gcc-dev1 + - CFG: compile-gcc VALGRIND: 1 - CFG: clang-sanitizers VALGRIND: 0 @@ -203,7 +195,7 @@ jobs: - name: Build run: | - ./configure --enable-debugbuild --enable-fuzzing --enable-developer --disable-valgrind CC=clang + ./configure --enable-debugbuild --enable-fuzzing --disable-valgrind CC=clang make -j $(nproc) check-fuzz integration: @@ -221,47 +213,36 @@ jobs: fail-fast: true matrix: include: - - NAME: gcc-dev1 - CFG: gcc-dev1 - DEVELOPER: 1 - TEST_DB_PROVIDER: sqlite3 - COMPILER: gcc - TEST_NETWORK: regtest - - NAME: gcc-dev0 - CFG: gcc-dev0 - DEVELOPER: 0 + - NAME: gcc + CFG: compile-gcc TEST_DB_PROVIDER: sqlite3 COMPILER: gcc TEST_NETWORK: regtest # While we're at it let's try to compile with clang - - NAME: clang-dev1 - CFG: clang-dev1 - DEVELOPER: 1 + - NAME: clang + CFG: compile-clang TEST_DB_PROVIDER: sqlite3 COMPILER: clang TEST_NETWORK: regtest # And of course we want to test postgres too - NAME: postgres - CFG: gcc-dev1 - DEVELOPER: 1 + CFG: compile-gcc COMPILER: gcc TEST_DB_PROVIDER: postgres TEST_NETWORK: regtest # And don't forget about elements (like cdecker did when # reworking the CI...) - NAME: liquid - CFG: gcc-dev1 - DEVELOPER: 1 + CFG: compile-gcc COMPILER: gcc TEST_NETWORK: liquid-regtest TEST_DB_PROVIDER: sqlite3 # And dual funding! - NAME: dual-fund - CFG: gcc-dev1 + CFG: compile-gcc TEST_DB_PROVIDER: sqlite3 COMPILER: gcc TEST_NETWORK: regtest - DEVELOPER: 1 EXPERIMENTAL_DUAL_FUND: 1 steps: - name: Checkout @@ -287,7 +268,6 @@ jobs: - name: Test env: - DEVELOPER: ${{ matrix.DEVELOPER }} COMPILER: ${{ matrix.COMPILER }} EXPERIMENTAL_DUAL_FUND: ${{ matrix.EXPERIMENTAL_DUAL_FUND }} COMPAT: 1 @@ -310,7 +290,7 @@ jobs: BITCOIN_VERSION: "25.0" ELEMENTS_VERSION: 22.0.2 RUST_PROFILE: release # Has to match the one in the compile step - CFG: gcc-dev1 + CFG: compile-gcc PYTEST_OPTS: --test-group-random-seed=42 --timeout=1800 needs: - compile @@ -359,10 +339,10 @@ jobs: - name: Download build uses: actions/download-artifact@v3 with: - name: cln-gcc-dev1.tar.bz2 + name: cln-compile-gcc.tar.bz2 - name: Unpack build - run: tar -xvjf cln-gcc-dev1.tar.bz2 + run: tar -xvjf cln-compile-gcc.tar.bz2 - name: Test env: @@ -432,10 +412,10 @@ jobs: - name: Download build uses: actions/download-artifact@v3 with: - name: cln-clang-sanitizers.tar.bz2 + name: cln-compile-clang-sanitizers.tar.bz2 - name: Unpack build - run: tar -xvjf cln-clang-sanitizers.tar.bz2 + run: tar -xvjf cln-compile-clang-sanitizers.tar.bz2 - name: Test run: | diff --git a/.github/workflows/macos.yaml b/.github/workflows/macos.yaml index 280052d32886..dcc30836fb9e 100644 --- a/.github/workflows/macos.yaml +++ b/.github/workflows/macos.yaml @@ -55,5 +55,5 @@ jobs: slow_test: marks tests as slow (deselect with '-m "not slow_test"') EOF - python3.10 -m poetry run ./configure --enable-developer --disable-valgrind --disable-compat + python3.10 -m poetry run ./configure --disable-valgrind --disable-compat python3.10 -m poetry run make diff --git a/.github/workflows/prototest.yaml b/.github/workflows/prototest.yaml index 5fb9479a792e..1e1fb168491a 100644 --- a/.github/workflows/prototest.yaml +++ b/.github/workflows/prototest.yaml @@ -28,7 +28,6 @@ jobs: -e NETWORK=${{ matrix.network }} \ -e TARGET_HOST=${{ matrix.TARGET_HOST }} \ -e VALGRIND=${{ matrix.valgrind }} \ - -e DEVELOPER=1 \ -e PYTEST_PAR=2 \ -e PYTEST_OPTS="--timeout=300" \ -e TEST_CMD="make check-protos" \ diff --git a/Dockerfile b/Dockerfile index 1af5d15955bb..88b1ca2690fc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -96,7 +96,6 @@ COPY . /tmp/lightning RUN git clone --recursive /tmp/lightning . && \ git checkout $(git --work-tree=/tmp/lightning --git-dir=/tmp/lightning/.git rev-parse HEAD) -ARG DEVELOPER=1 ENV PYTHON_VERSION=3 RUN curl -sSL https://install.python-poetry.org | python3 - \ && pip3 install -U pip \ @@ -104,7 +103,7 @@ RUN curl -sSL https://install.python-poetry.org | python3 - \ && /root/.local/bin/poetry install RUN ./configure --prefix=/tmp/lightning_install --enable-static && \ - make DEVELOPER=${DEVELOPER} && \ + make && \ /root/.local/bin/poetry run make install FROM debian:bullseye-slim as final diff --git a/Makefile b/Makefile index 39d8830012e3..13ef261b74c8 100644 --- a/Makefile +++ b/Makefile @@ -453,11 +453,7 @@ check-protos: $(ALL_PROGRAMS) ifeq ($(PYTEST),) @echo "py.test is required to run the protocol tests, please install using 'pip3 install -r requirements.txt', and rerun 'configure'."; false else -ifeq ($(DEVELOPER),1) - @(cd external/lnprototest && PYTHONPATH=$(MY_CHECK_PYTHONPATH) LIGHTNING_SRC=../.. $(PYTEST) --runner lnprototest.clightning.Runner $(PYTEST_OPTS)) -else - @echo "lnprototest target requires DEVELOPER=1, skipping" -endif + @(cd external/lnprototest && PYTHONPATH=$(MY_CHECK_PYTHONPATH) LIGHTNING_SRC=../.. $(PYTEST) --runner lnprototest.clightning.Runner --runner_args=--developer $(PYTEST_OPTS)) endif pytest: $(ALL_PROGRAMS) $(DEFAULT_TARGETS) $(ALL_TEST_PROGRAMS) $(ALL_TEST_GEN) @@ -465,8 +461,8 @@ ifeq ($(PYTEST),) @echo "py.test is required to run the integration tests, please install using 'pip3 install -r requirements.txt', and rerun 'configure'." exit 1 else -# Explicitly hand DEVELOPER and VALGRIND so you can override on make cmd line. - PYTHONPATH=$(MY_CHECK_PYTHONPATH) TEST_DEBUG=1 DEVELOPER=$(DEVELOPER) VALGRIND=$(VALGRIND) $(PYTEST) tests/ $(PYTEST_OPTS) +# Explicitly hand VALGRIND so you can override on make cmd line. + PYTHONPATH=$(MY_CHECK_PYTHONPATH) TEST_DEBUG=1 VALGRIND=$(VALGRIND) $(PYTEST) tests/ $(PYTEST_OPTS) endif check-fuzz: $(ALL_FUZZ_TARGETS) @@ -729,13 +725,7 @@ pyln-release: $(PYLNS:%=pyln-release-%) pyln-release-%: cd contrib/pyln-$* && $(MAKE) prod-release -# These must both be enabled for update-mocks -ifeq ($(DEVELOPER),1) update-mocks: $(ALL_TEST_PROGRAMS:%=update-mocks/%.c) -else -update-mocks: - @echo Need DEVELOPER=1 to regenerate mocks >&2; exit 1 -endif $(ALL_TEST_PROGRAMS:%=update-mocks/%.c): $(ALL_GEN_HEADERS) $(EXTERNAL_LIBS) libccan.a ccan/ccan/cdump/tools/cdump-enumstr config.vars diff --git a/README.md b/README.md index 79b1deb62bbf..938d5f1c63fc 100644 --- a/README.md +++ b/README.md @@ -66,13 +66,6 @@ of the `startup_regtest.sh` file for details on how to use it. . contrib/startup_regtest.sh ``` -Note that your local nodeset will be much faster/more responsive if -you've configured your node to expose the developer options, e.g. - -```bash -./configure --enable-developer -``` - #### Mainnet Option To test with real bitcoin, you will need to have a local `bitcoind` node running: @@ -222,7 +215,7 @@ If you encrypt your `hsm_secret`, you will have to pass the `--encrypted-hsm` st ### Developers Developers wishing to contribute should start with the developer guide [here](doc/HACKING.md). -You should also configure with `--enable-developer` to get additional checks and options. +You should also enable developer mode by running with `--developer` to get additional checks and options. [blockstream-store-blog]: https://blockstream.com/2018/01/16/en-lightning-charge/ [std]: https://github.com/lightning/bolts diff --git a/common/utils.h b/common/utils.h index 8f5cc4cb36da..efa8507db126 100644 --- a/common/utils.h +++ b/common/utils.h @@ -128,17 +128,6 @@ STRUCTEQ_DEF(ripemd160, 0, u); * complained on, so we can re-test as gcc evolves. */ #define COMPILER_WANTS_INIT(compiler_versions) = 0 -/* For case where we want one thing if DEVELOPER, another if not, particularly - * for function parameters. - * - * Usefully, you can refer to DEVELOPER-only fields here. */ -#if DEVELOPER -/* Make sure that nondev is evaluated, and valid */ -#define IFDEV(dev, nondev) ((void)(nondev), (dev)) -#else -#define IFDEV(dev, nondev) (nondev) -#endif - /* Context which all wally allocations use (see common/setup.c) */ extern const tal_t *wally_tal_ctx; diff --git a/configure b/configure index 8a5b00c1f43f..99530f1dc35f 100755 --- a/configure +++ b/configure @@ -141,10 +141,7 @@ set_defaults() PREFIX=${PREFIX:-/usr/local} CC=${CC:-cc} CDEBUGFLAGS=${CDEBUGFLAGS--std=gnu11 -g -fstack-protector-strong} - DEVELOPER=${DEVELOPER:-0} DEBUGBUILD=${DEBUGBUILD:-0} - # --enable-developer forces debug build - [ "$DEVELOPER" = 0 ] || DEBUGBUILD=1 COMPAT=${COMPAT:-1} STATIC=${STATIC:-0} CLANG_COVERAGE=${CLANG_COVERAGE:-0} @@ -199,8 +196,6 @@ usage() echo "Options include:" usage_with_default "--prefix=" "$PREFIX" echo " Prefix for make install" - usage_with_default "--enable/disable-developer" "$DEVELOPER" "enable" "disable" - echo " Developer mode, good for testing" usage_with_default "--enable/disable-debug" "$DEBUGBUILD" "enable" "disable" echo " Extra debug checks in the build, good for testing" usage_with_default "--enable/disable-compat" "$COMPAT" "enable" "disable" @@ -264,8 +259,6 @@ for opt in "$@"; do COPTFLAGS=*) COPTFLAGS="${opt#COPTFLAGS=}";; PYTEST=*) PYTEST="${opt#PYTEST=}";; --prefix=*) PREFIX="${opt#--prefix=}";; - --enable-developer) DEVELOPER=1;; - --disable-developer) DEVELOPER=0;; --enable-debugbuild) DEBUGBUILD=1;; --disable-debugbuild) DEBUGBUILD=0;; --enable-compat) COMPAT=1;; @@ -500,7 +493,6 @@ add_var SQLITE3_LDLIBS "$SQLITE3_LDLIBS" add_var POSTGRES_INCLUDE "$POSTGRES_INCLUDE" add_var POSTGRES_LDLIBS "$POSTGRES_LDLIBS" add_var VALGRIND "$VALGRIND" -add_var DEVELOPER "$DEVELOPER" $CONFIG_HEADER.$$ add_var DEBUGBUILD "$DEBUGBUILD" add_var COMPAT "$COMPAT" $CONFIG_HEADER.$$ add_var PYTEST "$PYTEST" diff --git a/contrib/docker/linuxarm32v7.Dockerfile b/contrib/docker/linuxarm32v7.Dockerfile index 918d1d9b1647..e04334e394a5 100644 --- a/contrib/docker/linuxarm32v7.Dockerfile +++ b/contrib/docker/linuxarm32v7.Dockerfile @@ -107,7 +107,6 @@ COPY . /tmp/lightning RUN git clone --recursive /tmp/lightning . && \ git checkout $(git --work-tree=/tmp/lightning --git-dir=/tmp/lightning/.git rev-parse HEAD) -ARG DEVELOPER=0 ENV PYTHON_VERSION=3 RUN curl -sSL https://install.python-poetry.org | python3 - \ @@ -116,7 +115,7 @@ RUN curl -sSL https://install.python-poetry.org | python3 - \ && /root/.local/bin/poetry install RUN ./configure --prefix=/tmp/lightning_install --enable-static && \ -make DEVELOPER=${DEVELOPER} && \ +make && \ /root/.local/bin/poetry run make install FROM arm32v7/debian:bullseye-slim as final diff --git a/contrib/docker/linuxarm64v8.Dockerfile b/contrib/docker/linuxarm64v8.Dockerfile index 160120db4eae..6fac6f263023 100644 --- a/contrib/docker/linuxarm64v8.Dockerfile +++ b/contrib/docker/linuxarm64v8.Dockerfile @@ -108,7 +108,6 @@ COPY . /tmp/lightning RUN git clone --recursive /tmp/lightning . && \ git checkout $(git --work-tree=/tmp/lightning --git-dir=/tmp/lightning/.git rev-parse HEAD) -ARG DEVELOPER=0 ENV PYTHON_VERSION=3 RUN curl -sSL https://install.python-poetry.org | python3 - \ @@ -117,7 +116,7 @@ RUN curl -sSL https://install.python-poetry.org | python3 - \ && /root/.local/bin/poetry install RUN ./configure --prefix=/tmp/lightning_install --enable-static && \ -make DEVELOPER=${DEVELOPER} && \ +make && \ /root/.local/bin/poetry run make install FROM arm64v8/debian:bullseye-slim as final diff --git a/contrib/docker/scripts/build.sh b/contrib/docker/scripts/build.sh index 61368321b663..3037ae66af44 100755 --- a/contrib/docker/scripts/build.sh +++ b/contrib/docker/scripts/build.sh @@ -6,7 +6,6 @@ export BOLTDIR=bolts export CC=${COMPILER:-gcc} export COMPAT=${COMPAT:-1} export TEST_CHECK_DBSTMTS=${TEST_CHECK_DBSTMTS:-0} -export DEVELOPER=${DEVELOPER:-1} export PATH=$CWD/dependencies/bin:"$HOME"/.local/bin:"$PATH" export PYTEST_OPTS="--maxfail=5 --suppress-no-test-exit-code ${PYTEST_OPTS}" export PYTEST_PAR=${PYTEST_PAR:-10} diff --git a/doc/FAQ.md b/doc/FAQ.md index b56e4b8b6c99..f3ba54ff5c23 100644 --- a/doc/FAQ.md +++ b/doc/FAQ.md @@ -180,8 +180,8 @@ lightning-cli dev-forget-channel $NODEID This will perform additional checks on whether it is safe to forget the channel, and only then removes the channel from the DB. Notice -that this command is only available if CLN was compiled with -`DEVELOPER=1`. +that this command is only available if CLN was run with +`--developer`. ### My channel is stuck in state `CHANNELD_AWAITING_LOCKIN` @@ -245,7 +245,7 @@ There are 3 types of 'rescans' you can make: (You can specify an exact block to start scanning from, instead of depth from current height, by using a negative number.) - `dev-rescan-outputs`: A `lightningd` RPC call. Only available if your node has been - configured and built in DEVELOPER mode (i.e. `./configure --enable-developer`) This + started in developer mode (i.e. `--developer`) This will sync the state for known UTXOs in the `lightningd` wallet with `bitcoind`. As it only operates on outputs already seen on chain by the `lightningd` internal wallet, this will not find missing wallet funds. diff --git a/doc/FUZZING.md b/doc/FUZZING.md index 6805be820d8e..033581e386dc 100644 --- a/doc/FUZZING.md +++ b/doc/FUZZING.md @@ -24,7 +24,7 @@ a few sanitizers for bug detections as well as experimental features for an exte coverage (not required though). ``` -./configure --enable-developer --enable-address-sanitizer --enable-ub-sanitizer --enable-fuzzing --disable-valgrind CC=clang && make +./configure --enable-address-sanitizer --enable-ub-sanitizer --enable-fuzzing --disable-valgrind CC=clang && make ``` The targets will be built in `tests/fuzz/` as `fuzz-` binaries, with their best diff --git a/doc/HACKING.md b/doc/HACKING.md index 56f889d69d22..bf634dd9e468 100644 --- a/doc/HACKING.md +++ b/doc/HACKING.md @@ -91,8 +91,7 @@ Here's a list of parts, with notes: Debugging --------- -You can build Core Lightning with DEVELOPER=1 to use dev commands listed in -``cli/lightning-cli help``. ``./configure --enable-developer`` will do that. +There are various development options enabled by running with `--developer`. You can log console messages with log_info() in lightningd and status_debug() in other subdaemons. @@ -170,7 +169,7 @@ sudo apt install valgrind cppcheck shellcheck libsecp256k1-dev libpq-dev Re-run `configure` and build using `make`: ``` -./configure --enable-developer +./configure make -j$(nproc) ``` @@ -180,14 +179,13 @@ Testing Tests are run with: `make check [flags]` where the pertinent flags are: ``` -DEVELOPER=[0|1] - developer mode increases test coverage VALGRIND=[0|1] - detects memory leaks during test execution but adds a significant delay PYTEST_PAR=n - runs pytests in parallel ``` A modern desktop can build and run through all the tests in a couple of minutes with: - make -j12 full-check PYTEST_PAR=24 DEVELOPER=1 VALGRIND=0 + make -j12 full-check PYTEST_PAR=24 VALGRIND=0 Adjust `-j` and `PYTEST_PAR` accordingly for your hardware. diff --git a/doc/INSTALL.md b/doc/INSTALL.md index ed13e599b4f4..5467d44ad134 100644 --- a/doc/INSTALL.md +++ b/doc/INSTALL.md @@ -91,7 +91,7 @@ To build core lightning for development purpose you can use the following comman This will put you in a new shell to enter the following commands: poetry install - ./configure --enable-developer + ./configure make make check VALGRIND=0 @@ -376,7 +376,7 @@ the build for the target device environment. Build with: BUILD=x86_64 MAKE_HOST=arm-linux-androideabi \ - make PIE=1 DEVELOPER=0 \ + make PIE=1 \ CONFIGURATOR_CC="arm-linux-androideabi-clang -static" To cross-compile for Raspberry Pi diff --git a/doc/guides/Beginner-s Guide/beginners-guide.md b/doc/guides/Beginner-s Guide/beginners-guide.md index 7770beb76c59..40d57ff4eeab 100644 --- a/doc/guides/Beginner-s Guide/beginners-guide.md +++ b/doc/guides/Beginner-s Guide/beginners-guide.md @@ -16,15 +16,7 @@ If you want to experiment with `lightningd`, there's a script to set up a `bitco . contrib/startup_regtest.sh ``` - - -Note that your local nodeset will be much faster/more responsive if you've configured your node to expose the developer options, e.g. - -```bash -./configure --enable-developer -``` - - +(Note this starts the nodes in developer mode, which speeds up some gossip operations and allows access to various `dev` commands and options). #### Mainnet Option @@ -73,4 +65,4 @@ Once you've started for the first time, there's a script called `contrib/bootstr There are also numerous plugins available for Core Lightning which add capabilities: see the [Plugins](doc:plugins) guide, and check out the plugin collection at: , including [helpme](https://github.com/lightningd/plugins/tree/master/helpme) which guides you through setting up your first channels and customising your node. -For a less reckless experience, you can encrypt the HD wallet seed: see [HD wallet encryption](doc:securing-keys). \ No newline at end of file +For a less reckless experience, you can encrypt the HD wallet seed: see [HD wallet encryption](doc:securing-keys). diff --git a/doc/guides/Contribute to Core Lightning/contributor-workflow.md b/doc/guides/Contribute to Core Lightning/contributor-workflow.md index 93e863548daf..291ee5a0d6f4 100644 --- a/doc/guides/Contribute to Core Lightning/contributor-workflow.md +++ b/doc/guides/Contribute to Core Lightning/contributor-workflow.md @@ -20,7 +20,7 @@ sudo apt install valgrind cppcheck shellcheck libsecp256k1-dev libpq-dev Re-run `configure` and build using `make`: ```shell -./configure --enable-developer +./configure make -j$(nproc) ``` @@ -28,15 +28,14 @@ make -j$(nproc) ## Debugging -You can build Core Lightning with `DEVELOPER=1` to use dev commands listed in `cli/lightning-cli help`. `./configure --enable-developer` will do that. You can log console messages with log_info() in lightningd and status_debug() in other subdaemons. +You can run Core Lightning with `developer` to use dev commands listed in `cli/lightning-cli help` and various `dev` options. You can log console messages with log_info() in lightningd and status_debug() in other subdaemons. You can debug crashing subdaemons with the argument `--dev-debugger=channeld`, where `channeld` is the subdaemon name. It will run `gnome-terminal` by default with a gdb attached to the subdaemon when it starts. You can change the terminal used by setting the `DEBUG_TERM` environment variable, such as `DEBUG_TERM="xterm -e"` or `DEBUG_TERM="konsole -e"`. It will also print out (to stderr) the gdb command for manual connection. The subdaemon will be stopped (it sends itself a `SIGSTOP`); you'll need to `continue` in gdb. ```shell -./configure --enable-developer -make -j$(nproc) +./lightningd/lightningd --developer ``` @@ -154,4 +153,4 @@ Here's a checklist for the release process. 1. Look through PRs which were delayed for release and merge them. 2. Close out the Milestone for the now-shipped release. -3. Update this file with any missing or changed instructions. \ No newline at end of file +3. Update this file with any missing or changed instructions. diff --git a/doc/guides/Contribute to Core Lightning/testing.md b/doc/guides/Contribute to Core Lightning/testing.md index 5fb8939bc7cd..5b63ac9c8238 100644 --- a/doc/guides/Contribute to Core Lightning/testing.md +++ b/doc/guides/Contribute to Core Lightning/testing.md @@ -11,8 +11,7 @@ updatedAt: "2023-04-22T11:58:25.622Z" Tests are run with: `make check [flags]` where the pertinent flags are: ```shell -DEVELOPER=[0|1] - developer mode increases test coverage -VALGRIND=[0|1] - detects memory leaks during test execution but adds a significant delay +VALGRIND=[0|1] - detects memory overruns during test execution but adds a significant delay PYTEST_PAR=n - runs pytests in parallel ``` @@ -21,7 +20,7 @@ PYTEST_PAR=n - runs pytests in parallel A modern desktop can build and run through all the tests in a couple of minutes with: ```shell Shell -make -j12 full-check PYTEST_PAR=24 DEVELOPER=1 VALGRIND=0 +make -j12 full-check PYTEST_PAR=24 VALGRIND=0 ``` @@ -99,10 +98,10 @@ For more info about fuzzing see [here](https://github.com/google/fuzzing/tree/ma In order to build the Core Lightning binaries with code coverage you will need a recent [clang](http://clang.llvm.org/). The more recent the compiler version the better. -Then you'll need to enable support at configuration time. You likely want to enable a few sanitizers for bug detections as well as experimental features for an extended coverage (not required though). +Then you'll need to enable support at configuration time. You likely want to enable a few sanitizers for bug detections (not required though). ```shell -DEVELOPER=1 EXPERIMENTAL_FEATURES=1 ASAN=1 UBSAN=1 VALGRIND=0 FUZZING=1 CC=clang ./configure && make +./configure CC=clang --enable-debugbuild --enable-address-sanitizer --enable-ub-sanitizer --enable-fuzzing --disable-valgrind && make ``` @@ -197,4 +196,4 @@ In order to write a new target: - fill two functions: `init()` for static stuff and `run()` which will be called repeatedly with mutated data. - read about [what makes a good fuzz target](https://github.com/google/fuzzing/blob/master/docs/good-fuzz-target.md). -A simple example is [`fuzz-addr`](https://github.com/ElementsProject/lightning/blob/master/tests/fuzz/fuzz-addr.c). It setups the chainparams and context (wally, tmpctx, ..) in `init()` then bruteforces the bech32 encoder in `run()`. \ No newline at end of file +A simple example is [`fuzz-addr`](https://github.com/ElementsProject/lightning/blob/master/tests/fuzz/fuzz-addr.c). It setups the chainparams and context (wally, tmpctx, ..) in `init()` then bruteforces the bech32 encoder in `run()`. diff --git a/doc/guides/Getting Started/getting-started/installation.md b/doc/guides/Getting Started/getting-started/installation.md index 2e6a14fe1ae2..771765a9fca7 100644 --- a/doc/guides/Getting Started/getting-started/installation.md +++ b/doc/guides/Getting Started/getting-started/installation.md @@ -167,7 +167,7 @@ This will put you in a new shell to enter the following commands: ```shell poetry install -./configure --enable-developer +./configure make make check VALGRIND=0 ``` @@ -546,7 +546,7 @@ Build with: ```shell BUILD=x86_64 MAKE_HOST=arm-linux-androideabi \ - make PIE=1 DEVELOPER=0 \ + make PIE=1 \ CONFIGURATOR_CC="arm-linux-androideabi-clang -static" ``` @@ -686,4 +686,4 @@ Install runtime dependencies: ```shell apk add gmp libgcc libsodium sqlite-libs zlib -``` \ No newline at end of file +``` diff --git a/doc/guides/Node Operator-s Guide/faq.md b/doc/guides/Node Operator-s Guide/faq.md index 46d33ff0698c..c3efb72dd67d 100644 --- a/doc/guides/Node Operator-s Guide/faq.md +++ b/doc/guides/Node Operator-s Guide/faq.md @@ -143,7 +143,7 @@ lightning-cli dev-forget-channel $NODEID -This will perform additional checks on whether it is safe to forget the channel, and only then removes the channel from the DB. Notice that this command is only available if CLN was compiled with `DEVELOPER=1`. +This will perform additional checks on whether it is safe to forget the channel, and only then removes the channel from the DB. Notice that this command is only available if CLN was started with `--developer`. ### My channel is stuck in state `CHANNELD_AWAITING_LOCKIN` @@ -192,7 +192,7 @@ There are 3 types of 'rescans' you can make: - `rescanblockchain`: A `bitcoind` RPC call which rescans the blockchain starting at the given height. This does not have an effect on Core Lightning as `lightningd` tracks all block and wallet data independently. - `--rescan=depth`: A `lightningd` configuration flag. This flag is read at node startup and tells lightningd at what depth from current blockheight to rebuild its internal state. (You can specify an exact block to start scanning from, instead of depth from current height, by using a negative number) -- `dev-rescan-outputs`: A `lightningd` RPC call. Only available if your node has been configured and built in DEVELOPER mode (i.e. `./configure --enable-developer`) This will sync the state for known UTXOs in the `lightningd` wallet with `bitcoind`. As it only operates on outputs already seen on chain by the `lightningd` internal wallet, this will not find missing wallet funds. +- `dev-rescan-outputs`: A `lightningd` RPC call. Only available if your node has been started with the `developer` option. This will sync the state for known UTXOs in the `lightningd` wallet with `bitcoind`. As it only operates on outputs already seen on chain by the `lightningd` internal wallet, this will not find missing wallet funds. ### Database corruption / channel state lost @@ -216,4 +216,4 @@ If `option_static_remotekey` is enabled you can attempt to recover the funds in ### How do I get the `psbt` for RPC calls that need it? -A `psbt` is created and returned by a call to [`utxopsbt` with `reservedok=true`](ref:lightning-utxopsbt). \ No newline at end of file +A `psbt` is created and returned by a call to [`utxopsbt` with `reservedok=true`](ref:lightning-utxopsbt). diff --git a/lightningd/lightningd.c b/lightningd/lightningd.c index c7fca3068def..54cde9b1ee6d 100644 --- a/lightningd/lightningd.c +++ b/lightningd/lightningd.c @@ -110,7 +110,7 @@ static struct lightningd *new_lightningd(const tal_t *ctx) * should use 'const' on pointers if you can. */ /* They can turn this on with --developer */ - ld->developer = IFDEV(true, false); + ld->developer = false; /*~ We used to EXPLICITLY #if-wrap DEVELOPER code, but as our test * matrix grew, we turned them into a --developer runtime option. diff --git a/tools/build-release.sh b/tools/build-release.sh index f49c284b1759..b9b39b337986 100755 --- a/tools/build-release.sh +++ b/tools/build-release.sh @@ -135,7 +135,7 @@ if [ -z "${TARGETS##* tarball *}" ]; then # Materialize the version in the Makefile, allows us to skip # the git dependency sed -i "/^VERSION=/c\VERSION=v${BARE_VERSION}" "Makefile" - ./configure --disable-valgrind --enable-developer + ./configure --disable-valgrind --enable-debugbuild make doc-all check-gen-updated clean find . -name .git -type d -print0 | xargs -0 /bin/rm -rf )