Skip to content

Commit

Permalink
build: remove --enable-experimental-features / EXPERIMENTAL_FEATURES
Browse files Browse the repository at this point in the history
Changelog-EXPERIMENTAL: Build: all experimental features are now runtime-enabled; no more ./configure --enable-experimental-features
Signed-off-by: Rusty Russell <[email protected]>
  • Loading branch information
rustyrussell committed May 23, 2023
1 parent c11ae1a commit e7d4c31
Show file tree
Hide file tree
Showing 18 changed files with 25 additions and 101 deletions.
1 change: 0 additions & 1 deletion .github/scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ export CC=${COMPILER:-gcc}
export COMPAT=${COMPAT:-1}
export TEST_CHECK_DBSTMTS=${TEST_CHECK_DBSTMTS:-0}
export DEVELOPER=${DEVELOPER:-1}
export EXPERIMENTAL_FEATURES=${EXPERIMENTAL_FEATURES:-0}
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}
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/bsd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,14 @@ jobs:
env:
DEVELOPER: 1
VALGRIND: 0
EXPERIMENTAL_FEATURES: 0
COMPAT: 1
steps:
- uses: actions/checkout@v2
- name: Test in FreeBSD
id: test
uses: vmactions/[email protected]
with:
envs: 'DEVELOPER VALGRIND EXPERIMENTAL_FEATURES COMPAT'
envs: 'DEVELOPER VALGRIND COMPAT'
usesh: true
prepare: |
pkg install -y \
Expand Down
62 changes: 14 additions & 48 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ jobs:
env:
COMPAT: 1
DEVELOPER: 1
EXPERIMENTAL_FEATURES: 1
ASAN: 1
UBSAN: 1
VALGRIND: 0
Expand Down Expand Up @@ -137,26 +136,15 @@ jobs:
fail-fast: true
matrix:
include:
- CFG: gcc-dev1-exp1
- CFG: gcc-dev1
DEVELOPER: 1
EXPERIMENTAL_FEATURES: 1
COMPILER: gcc
- CFG: gcc-dev1-exp0
DEVELOPER: 1
EXPERIMENTAL_FEATURES: 0
COMPILER: gcc
- CFG: gcc-dev0-exp1
DEVELOPER: 0
EXPERIMENTAL_FEATURES: 1
COMPILER: gcc
- CFG: gcc-dev0-exp0
- CFG: gcc-dev0
DEVELOPER: 0
EXPERIMENTAL_FEATURES: 0
COMPILER: gcc
# While we're at it let's try to compile with clang
- CFG: clang-dev1-exp1
- CFG: clang-dev1
DEVELOPER: 1
EXPERIMENTAL_FEATURES: 1
COMPILER: clang
steps:
- name: Checkout
Expand All @@ -175,7 +163,6 @@ jobs:
env:
VALGRIND: ${{ matrix.VALGRIND }}
DEVELOPER: ${{ matrix.DEVELOPER }}
EXPERIMENTAL_FEATURES: ${{ matrix.EXPERIMENTAL_FEATURES }}
COMPILER: ${{ matrix.COMPILER }}
COMPAT: 1
CFG: ${{ matrix.CFG }}
Expand Down Expand Up @@ -213,56 +200,37 @@ jobs:
fail-fast: true
matrix:
include:
- NAME: gcc-dev1-exp1
CFG: gcc-dev1-exp1
DEVELOPER: 1
EXPERIMENTAL_FEATURES: 1
TEST_DB_PROVIDER: sqlite3
COMPILER: gcc
TEST_NETWORK: regtest
- NAME: gcc-dev1-exp0
CFG: gcc-dev1-exp0
- NAME: gcc-dev1
CFG: gcc-dev1
DEVELOPER: 1
EXPERIMENTAL_FEATURES: 0
TEST_DB_PROVIDER: sqlite3
COMPILER: gcc
TEST_NETWORK: regtest
- NAME: gcc-dev0-exp1
CFG: gcc-dev0-exp1
DEVELOPER: 0
EXPERIMENTAL_FEATURES: 1
TEST_DB_PROVIDER: sqlite3
COMPILER: gcc
TEST_NETWORK: regtest
- NAME: gcc-dev0-exp0
CFG: gcc-dev0-exp0
- NAME: gcc-dev0
CFG: gcc-dev0
DEVELOPER: 0
EXPERIMENTAL_FEATURES: 0
TEST_DB_PROVIDER: sqlite3
COMPILER: gcc
TEST_NETWORK: regtest
# While we're at it let's try to compile with clang
- NAME: clang-dev1-exp1
CFG: clang-dev1-exp1
- NAME: clang-dev1
CFG: clang-dev1
DEVELOPER: 1
EXPERIMENTAL_FEATURES: 1
TEST_DB_PROVIDER: sqlite3
COMPILER: clang
TEST_NETWORK: regtest
# And of course we want to test postgres too
- NAME: postgres
CFG: gcc-dev1-exp1
CFG: gcc-dev1
DEVELOPER: 1
EXPERIMENTAL_FEATURES: 1
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-exp1
CFG: gcc-dev1
DEVELOPER: 1
EXPERIMENTAL_FEATURES: 1
COMPILER: gcc
TEST_NETWORK: liquid-regtest
TEST_DB_PROVIDER: sqlite3
Expand Down Expand Up @@ -292,7 +260,6 @@ jobs:
env:
VALGRIND: ${{ matrix.VALGRIND }}
DEVELOPER: ${{ matrix.DEVELOPER }}
EXPERIMENTAL_FEATURES: ${{ matrix.EXPERIMENTAL_FEATURES }}
COMPILER: ${{ matrix.COMPILER }}
COMPAT: 1
CFG: ${{ matrix.CFG }}
Expand All @@ -315,9 +282,8 @@ jobs:
ELEMENTS_VERSION: 22.0.2
RUST_PROFILE: release # Has to match the one in the compile step
VALGRIND: 1
CFG: gcc-dev1-exp1
CFG: gcc-dev1
DEVELOPER: 1
EXPERIMENTAL_FEATURES: 1
PYTEST_OPTS: --test-group-random-seed=42 --timeout=1800
needs:
- compile
Expand Down Expand Up @@ -366,10 +332,10 @@ jobs:
- name: Download build
uses: actions/download-artifact@v3
with:
name: cln-gcc-dev1-exp1.tar.bz2
name: cln-gcc-dev1.tar.bz2

- name: Unpack build
run: tar -xvjf cln-gcc-dev1-exp1.tar.bz2
run: tar -xvjf cln-gcc-dev1.tar.bz2

- name: Test
env:
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/macos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ jobs:
env:
DEVELOPER: 1
VALGRIND: 0
EXPERIMENTAL_FEATURES: 1
COMPAT: 0
strategy:
fail-fast: true
Expand Down Expand Up @@ -42,7 +41,6 @@ jobs:
env:
VALGRIND: ${{ matrix.VALGRIND }}
DEVELOPER: ${{ matrix.DEVELOPER }}
EXPERIMENTAL_FEATURES: ${{ matrix.EXPERIMENTAL_FEATURES }}
COMPILER: ${{ matrix.COMPILER }}
COMPAT: ${{ matrix.COMPAT }}
PYTEST_PAR: ${{ matrix.PYTEST_PAR }}
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/prototest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ jobs:
-e TARGET_HOST=${{ matrix.TARGET_HOST }} \
-e VALGRIND=${{ matrix.valgrind }} \
-e DEVELOPER=1 \
-e EXPERIMENTAL_FEATURES=1 \
-e COMPAT=0 \
-e PYTEST_PAR=2 \
-e PYTEST_OPTS="--timeout=300" \
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -719,11 +719,11 @@ pyln-release-%:
cd contrib/pyln-$* && $(MAKE) prod-release

# These must both be enabled for update-mocks
ifeq ($(DEVELOPER)$(EXPERIMENTAL_FEATURES),11)
ifeq ($(DEVELOPER),1)
update-mocks: $(ALL_TEST_PROGRAMS:%=update-mocks/%.c)
else
update-mocks:
@echo Need DEVELOPER=1 and EXPERIMENTAL_FEATURES=1 to regenerate mocks >&2; exit 1
@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
Expand Down
2 changes: 0 additions & 2 deletions common/interactivetx.c
Original file line number Diff line number Diff line change
Expand Up @@ -714,10 +714,8 @@ char *process_interactivetx_updates(const tal_t *ctx,
case WIRE_PING:
case WIRE_PONG:
case WIRE_STFU:
#if EXPERIMENTAL_FEATURES
case WIRE_SPLICE:
case WIRE_SPLICE_ACK:
#endif
return tal_fmt(ctx, "Unexpected wire message %s",
tal_hex(ctx, msg));
}
Expand Down
4 changes: 0 additions & 4 deletions common/test/Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
COMMON_TEST_SRC := $(wildcard common/test/run-*.c)

ifeq ($(EXPERIMENTAL_FEATURES),1)
COMMON_TEST_SRC += $(wildcard common/test/exp-run-*.c)
endif

COMMON_TEST_OBJS := $(COMMON_TEST_SRC:.c=.o)
COMMON_TEST_PROGRAMS := $(COMMON_TEST_OBJS:.o=)

Expand Down
7 changes: 0 additions & 7 deletions common/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -153,13 +153,6 @@ STRUCTEQ_DEF(ripemd160, 0, u);
#define IFDEV(dev, nondev) (nondev)
#endif

#if EXPERIMENTAL_FEATURES
/* Make sure that nondev is evaluated, and valid, but is a constant */
#define IFEXPERIMENTAL(exp, nonexp) (0 ? (nonexp) : (exp))
#else
#define IFEXPERIMENTAL(exp, nonexp) (nonexp)
#endif

/* Context which all wally allocations use (see common/setup.c) */
extern const tal_t *wally_tal_ctx;

Expand Down
6 changes: 0 additions & 6 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@ set_defaults()
CC=${CC:-cc}
CDEBUGFLAGS=${CDEBUGFLAGS--std=gnu11 -g -fstack-protector-strong}
DEVELOPER=${DEVELOPER:-0}
EXPERIMENTAL_FEATURES=${EXPERIMENTAL_FEATURES:-0}
COMPAT=${COMPAT:-1}
STATIC=${STATIC:-0}
ASAN=${ASAN:-0}
Expand Down Expand Up @@ -198,8 +197,6 @@ usage()
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-experimental-features" "$EXPERIMENTAL_FEATURES" "enable" "disable"
echo " Enable experimental features"
usage_with_default "--enable/disable-compat" "$COMPAT" "enable" "disable"
echo " Compatibility mode, good to disable to see if your software breaks"
usage_with_default "--enable/disable-valgrind" "(autodetect)"
Expand Down Expand Up @@ -260,8 +257,6 @@ for opt in "$@"; do
--prefix=*) PREFIX="${opt#--prefix=}";;
--enable-developer) DEVELOPER=1;;
--disable-developer) DEVELOPER=0;;
--enable-experimental-features) EXPERIMENTAL_FEATURES=1;;
--disable-experimental-features) EXPERIMENTAL_FEATURES=0;;
--enable-compat) COMPAT=1;;
--disable-compat) COMPAT=0;;
--enable-valgrind) VALGRIND=1;;
Expand Down Expand Up @@ -482,7 +477,6 @@ add_var POSTGRES_INCLUDE "$POSTGRES_INCLUDE"
add_var POSTGRES_LDLIBS "$POSTGRES_LDLIBS"
add_var VALGRIND "$VALGRIND"
add_var DEVELOPER "$DEVELOPER" $CONFIG_HEADER.$$
add_var EXPERIMENTAL_FEATURES "$EXPERIMENTAL_FEATURES" $CONFIG_HEADER.$$
add_var COMPAT "$COMPAT" $CONFIG_HEADER.$$
add_var PYTEST "$PYTEST"
add_var STATIC "$STATIC"
Expand Down
1 change: 0 additions & 1 deletion contrib/docker/scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ export CC=${COMPILER:-gcc}
export COMPAT=${COMPAT:-1}
export TEST_CHECK_DBSTMTS=${TEST_CHECK_DBSTMTS:-0}
export DEVELOPER=${DEVELOPER:-1}
export EXPERIMENTAL_FEATURES=${EXPERIMENTAL_FEATURES:-0}
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}
Expand Down
2 changes: 1 addition & 1 deletion doc/FUZZING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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-experimental-features --enable-address-sanitizer --enable-ub-sanitizer --enable-fuzzing --disable-valgrind CC=clang && make
./configure --enable-developer --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
Expand Down
2 changes: 1 addition & 1 deletion doc/STYLE.md
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ have a line with one of the following prefixes:
not yet removed
- `Changelog-Fixed: ` if a bug has been fixed
- `Changelog-Removed: ` if a (previously deprecated) feature has been removed
- `Changelog-Experimental: ` if it only affects --enable-experimental-features builds, or experimental- config options.
- `Changelog-Experimental: ` if it only affects experimental- config options.

In case you think the pull request is small enough not to require a changelog
entry please use `Changelog-None` in one of the commit messages to opt out.
Expand Down
16 changes: 3 additions & 13 deletions doc/lightningd-config.5.md
Original file line number Diff line number Diff line change
Expand Up @@ -664,28 +664,18 @@ considered important.

Experimental options are subject to breakage between releases: they
are made available for advanced users who want to test proposed
features. When the build is configured _without_ `--enable-experimental-features`,
below options are available but disabled by default.
Supported features can be listed with `lightningd --list-features-only`

A build _with_ `--enable-experimental-features` flag hard-codes some of below
options as enabled, ignoring their command line flag. It may also add support for
even more features. The safest way to determine the active configuration is by
checking `listconfigs` or by looking at `our_features` (bits) in `getinfo`.
features.

* **experimental-onion-messages**

Specifying this enables sending, forwarding and receiving onion messages,
which are in draft status in the [bolt][bolt] specifications (PR #759).
A build with `--enable-experimental-features` usually enables this via
experimental-offers, see below.
This is automatically enabled by `experimental-offers`.

* **experimental-offers**

Specifying this enables the `offers` and `fetchinvoice` plugins and
corresponding functionality, which are in draft status ([bolt][bolt] #798) as [bolt12][bolt12].
A build with `--enable-experimental-features` enables this permanently and usually
enables experimental-onion-messages as well.
corresponding functionality, which are in draft status ([bolt][bolt] #798) as [bolt12][bolt12], as well as `experimental-onion-messages`.

* **fetchinvoice-noconnect**

Expand Down
4 changes: 0 additions & 4 deletions lightningd/lightningd.c
Original file line number Diff line number Diff line change
Expand Up @@ -862,10 +862,6 @@ static struct feature_set *default_features(const tal_t *ctx)
OPTIONAL_FEATURE(OPT_ZEROCONF),
OPTIONAL_FEATURE(OPT_CHANNEL_TYPE),
OPTIONAL_FEATURE(OPT_ROUTE_BLINDING),
#if EXPERIMENTAL_FEATURES
OPTIONAL_FEATURE(OPT_ANCHOR_OUTPUTS),
OPTIONAL_FEATURE(OPT_ONION_MESSAGES),
#endif
};

for (size_t i = 0; i < ARRAY_SIZE(features); i++) {
Expand Down
4 changes: 2 additions & 2 deletions lightningd/options.c
Original file line number Diff line number Diff line change
Expand Up @@ -864,7 +864,7 @@ static const struct config testnet_config = {
/* 1 minute should be enough for anyone! */
.connection_timeout_secs = 60,

.exp_offers = IFEXPERIMENTAL(true, false),
.exp_offers = false,

.allowdustreserve = false,

Expand Down Expand Up @@ -938,7 +938,7 @@ static const struct config mainnet_config = {
/* 1 minute should be enough for anyone! */
.connection_timeout_secs = 60,

.exp_offers = IFEXPERIMENTAL(true, false),
.exp_offers = false,

.allowdustreserve = false,

Expand Down
2 changes: 1 addition & 1 deletion tools/build-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 --enable-experimental-features
./configure --disable-valgrind --enable-developer
make doc-all check-gen-updated clean
find . -name .git -type d -print0 | xargs -0 /bin/rm -rf
)
Expand Down
3 changes: 0 additions & 3 deletions wire/.gitignore

This file was deleted.

0 comments on commit e7d4c31

Please sign in to comment.