Преглед изворни кода

Move from "nightly" toolchain to "stable".

Intended to address tau RefID "Gifn1u".

There are still a few things that require nightly.
- cargo +nightly fmt
- fuzzing
Paul Otten пре 1 година
родитељ
комит
721502a468

+ 4 - 4
.github/workflows/book.yml

@@ -20,17 +20,17 @@ jobs:
               with:
               with:
                 python-version: 3.9
                 python-version: 3.9
 
 
-            - name: Install Rust (nightly)
+            - name: Install Rust
               uses: actions-rs/toolchain@v1
               uses: actions-rs/toolchain@v1
               with:
               with:
-                toolchain: nightly-2025-04-10
+                toolchain: stable
                 components: rustfmt, clippy
                 components: rustfmt, clippy
                 override: true
                 override: true
 
 
             - name: Install Rust (wasm32)
             - name: Install Rust (wasm32)
               uses: actions-rs/toolchain@v1
               uses: actions-rs/toolchain@v1
               with:
               with:
-                toolchain: nightly-2025-04-10
+                toolchain: stable
                 target: wasm32-unknown-unknown
                 target: wasm32-unknown-unknown
                 override: true
                 override: true
 
 
@@ -56,7 +56,7 @@ jobs:
                 git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
                 git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
                 git config --local user.name "bookworm"
                 git config --local user.name "bookworm"
                 cd doc
                 cd doc
-                make CARGO="cargo +nightly-2025-04-10" github
+                make github
                 git checkout gh-pages
                 git checkout gh-pages
 
 
             - name: Push changes
             - name: Push changes

+ 9 - 9
.github/workflows/ci.yml

@@ -13,11 +13,11 @@ jobs:
       - uses: actions/checkout@v4
       - uses: actions/checkout@v4
       - uses: actions-rs/toolchain@v1
       - uses: actions-rs/toolchain@v1
         with:
         with:
-          toolchain: nightly-2025-04-10
+          toolchain: stable
           override: true
           override: true
       - uses: actions-rs/toolchain@v1
       - uses: actions-rs/toolchain@v1
         with:
         with:
-          toolchain: nightly-2025-04-10
+          toolchain: stable
           target: wasm32-unknown-unknown
           target: wasm32-unknown-unknown
           override: true
           override: true
       - uses: actions/setup-python@v1
       - uses: actions/setup-python@v1
@@ -37,11 +37,11 @@ jobs:
 
 
       - name: Run test units
       - name: Run test units
         run: |
         run: |
-          make CARGO="cargo +nightly-2025-04-10" test
+          make test
 
 
       - name: Compile all bins
       - name: Compile all bins
         run: |
         run: |
-          make CARGO="cargo +nightly-2025-04-10"
+          make
 
 
   feature-powerset:
   feature-powerset:
     name: Test crate feature powerset on ${{ matrix.os }}
     name: Test crate feature powerset on ${{ matrix.os }}
@@ -54,11 +54,11 @@ jobs:
       - uses: actions/checkout@v4
       - uses: actions/checkout@v4
       - uses: actions-rs/toolchain@v1
       - uses: actions-rs/toolchain@v1
         with:
         with:
-          toolchain: nightly-2025-04-10
+          toolchain: stable
           override: true
           override: true
       - uses: actions-rs/toolchain@v1
       - uses: actions-rs/toolchain@v1
         with:
         with:
-          toolchain: nightly-2025-04-10
+          toolchain: stable
           target: wasm32-unknown-unknown
           target: wasm32-unknown-unknown
           override: true
           override: true
       - uses: taiki-e/install-action@cargo-hack
       - uses: taiki-e/install-action@cargo-hack
@@ -75,7 +75,7 @@ jobs:
 
 
       - name: Run feature powerset builds
       - name: Run feature powerset builds
         run: |
         run: |
-          make CARGO="cargo +nightly-2025-04-10" check
+          make check
 
 
   fmt:
   fmt:
     name: rustfmt
     name: rustfmt
@@ -85,8 +85,8 @@ jobs:
       - uses: actions/checkout@v4
       - uses: actions/checkout@v4
       - uses: actions-rs/toolchain@v1
       - uses: actions-rs/toolchain@v1
         with:
         with:
-          toolchain: nightly-2025-04-10
+          toolchain: nightly
           components: rustfmt
           components: rustfmt
           override: true
           override: true
       - run: |
       - run: |
-          cargo +nightly-2025-04-10 fmt -- --check
+          cargo +nightly fmt -- --check

+ 4 - 4
.github/workflows/lints-nightly.yml → .github/workflows/lints.yml

@@ -1,23 +1,23 @@
-name: Nightly lints
+name: Lints
 
 
 # We only run these on trial-merges of PRs to reduce noise.
 # We only run these on trial-merges of PRs to reduce noise.
 on: pull_request
 on: pull_request
 
 
 jobs:
 jobs:
   clippy:
   clippy:
-    name: Clippy (nightly)
+    name: Clippy
     timeout-minutes: 30
     timeout-minutes: 30
     runs-on: ubuntu-latest
     runs-on: ubuntu-latest
     steps:
     steps:
       - uses: actions/checkout@v4
       - uses: actions/checkout@v4
       - uses: actions-rs/toolchain@v1
       - uses: actions-rs/toolchain@v1
         with:
         with:
-          toolchain: nightly-2025-04-10
+          toolchain: stable
           components: clippy
           components: clippy
           override: true
           override: true
       - name: Run Clippy
       - name: Run Clippy
         uses: actions-rs/clippy-check@v1
         uses: actions-rs/clippy-check@v1
         with:
         with:
-          name: Clippy (stable)
+          name: Clippy
           token: ${{ secrets.GITHUB_TOKEN }}
           token: ${{ secrets.GITHUB_TOKEN }}
           args: --all-features --release -- -D warnings
           args: --all-features --release -- -D warnings

+ 2 - 2
Makefile

@@ -4,7 +4,7 @@
 PREFIX = $(HOME)/.cargo
 PREFIX = $(HOME)/.cargo
 
 
 # Cargo binary
 # Cargo binary
-CARGO = cargo +nightly
+CARGO = cargo
 
 
 # Compile target for system binaries
 # Compile target for system binaries
 RUST_TARGET = $(shell rustc -Vv | grep '^host: ' | cut -d' ' -f2)
 RUST_TARGET = $(shell rustc -Vv | grep '^host: ' | cut -d' ' -f2)
@@ -149,7 +149,7 @@ fu:
 # -- END OF BINS --
 # -- END OF BINS --
 
 
 fmt:
 fmt:
-	$(CARGO) fmt --all
+	$(CARGO) +nightly fmt --all
 
 
 # cargo install cargo-hack
 # cargo install cargo-hack
 check: explorerd_bundle_contracts_src $(PROOFS_BIN)
 check: explorerd_bundle_contracts_src $(PROOFS_BIN)

+ 2 - 35
README.md

@@ -44,17 +44,12 @@ This project requires the Rust compiler to be installed.
 Please visit [Rustup](https://rustup.rs/) for instructions.
 Please visit [Rustup](https://rustup.rs/) for instructions.
 
 
 You have to install a native toolchain, which is set up during Rust installation,
 You have to install a native toolchain, which is set up during Rust installation,
-nightly toolchain and wasm32 target.
-To install nightly toolchain, execute:
-```shell
-% rustup toolchain install nightly
-```
+and wasm32 target.
 To install wasm32 target, execute:
 To install wasm32 target, execute:
 ```shell
 ```shell
 % rustup target add wasm32-unknown-unknown
 % rustup target add wasm32-unknown-unknown
-% rustup target add wasm32-unknown-unknown --toolchain nightly
 ```
 ```
-Minimum Rust version supported is **1.77.0 (nightly)**.
+Minimum Rust version supported is **1.77.0**.
 
 
 The following dependencies are also required:
 The following dependencies are also required:
 
 
@@ -110,34 +105,6 @@ If you want to hack on the source code, make sure to read some
 introductory advice in the
 introductory advice in the
 [DarkFi book](https://darkrenaissance.github.io/darkfi/dev/dev.html).
 [DarkFi book](https://darkrenaissance.github.io/darkfi/dev/dev.html).
 
 
-### Living on the cutting edge
-
-Since the project uses the nightly toolchain, breaking changes are bound
-to happen from time to time. As a workaround, we can configure an older
-nightly version, which was known to work:
-
-```shell
-% rustup toolchain install nightly-2025-04-10
-% rustup target add wasm32-unknown-unknown --toolchain nightly-2025-04-10
-```
-
-Now we can use that toolchain in `make` directly:
-
-```shell
-% make CARGO="cargo +nightly-2025-04-10" {target}
-```
-
-Or, if we are lazy, we can modify the `Makefile` to always use that:
-
-```shell
-% sed -i Makefile -e "s|nightly|nightly-2025-04-10|g"
-```
-
-Under no circumstances commit or push the Makefile change.
-
-When using `cargo` directly, you have to add the `+nightly-2025-04-10` flag,
-in order for it to use the older nightly version.
-
 ## Install
 ## Install
 
 
 This will install the binaries on your system (`/usr/local` by
 This will install the binaries on your system (`/usr/local` by

+ 1 - 1
bin/darkfi-mmproxy/Makefile

@@ -4,7 +4,7 @@
 PREFIX = $(HOME)/.cargo
 PREFIX = $(HOME)/.cargo
 
 
 # Cargo binary
 # Cargo binary
-CARGO = cargo +nightly
+CARGO = cargo
 
 
 # Compile target
 # Compile target
 RUST_TARGET = $(shell rustc -Vv | grep '^host: ' | cut  -d' ' -f2)
 RUST_TARGET = $(shell rustc -Vv | grep '^host: ' | cut  -d' ' -f2)

+ 1 - 1
bin/darkfid/Makefile

@@ -4,7 +4,7 @@
 PREFIX = $(HOME)/.cargo
 PREFIX = $(HOME)/.cargo
 
 
 # Cargo binary
 # Cargo binary
-CARGO = cargo +nightly
+CARGO = cargo
 
 
 # Compile target
 # Compile target
 RUST_TARGET = $(shell rustc -Vv | grep '^host: ' | cut -d' ' -f2)
 RUST_TARGET = $(shell rustc -Vv | grep '^host: ' | cut -d' ' -f2)

+ 1 - 1
bin/darkirc/Makefile

@@ -4,7 +4,7 @@
 PREFIX = $(HOME)/.cargo
 PREFIX = $(HOME)/.cargo
 
 
 # Cargo binary
 # Cargo binary
-CARGO = cargo +nightly
+CARGO = cargo
 
 
 # Compile target
 # Compile target
 RUST_TARGET = $(shell rustc -Vv | grep '^host: ' | cut -d' ' -f2)
 RUST_TARGET = $(shell rustc -Vv | grep '^host: ' | cut -d' ' -f2)

+ 1 - 1
bin/drk/Makefile

@@ -4,7 +4,7 @@
 PREFIX = $(HOME)/.cargo
 PREFIX = $(HOME)/.cargo
 
 
 # Cargo binary
 # Cargo binary
-CARGO = cargo +nightly
+CARGO = cargo
 
 
 # Compile target
 # Compile target
 RUST_TARGET = $(shell rustc -Vv | grep '^host: ' | cut -d' ' -f2)
 RUST_TARGET = $(shell rustc -Vv | grep '^host: ' | cut -d' ' -f2)

+ 1 - 1
bin/explorer/explorerd/Makefile

@@ -7,7 +7,7 @@ MAKEFLAGS += --no-print-directory
 PREFIX = $(HOME)/.cargo
 PREFIX = $(HOME)/.cargo
 
 
 # Cargo binary
 # Cargo binary
-CARGO = cargo +nightly
+CARGO = cargo
 
 
 # Compile target
 # Compile target
 RUST_TARGET = $(shell rustc -Vv | grep '^host: ' | cut -d' ' -f2)
 RUST_TARGET = $(shell rustc -Vv | grep '^host: ' | cut -d' ' -f2)

+ 1 - 1
bin/genev/genev-cli/Makefile

@@ -4,7 +4,7 @@
 PREFIX = $(HOME)/.cargo
 PREFIX = $(HOME)/.cargo
 
 
 # Cargo binary
 # Cargo binary
-CARGO = cargo +nightly
+CARGO = cargo
 
 
 # Compile target
 # Compile target
 RUST_TARGET = $(shell rustc -Vv | grep '^host: ' | cut -d' ' -f2)
 RUST_TARGET = $(shell rustc -Vv | grep '^host: ' | cut -d' ' -f2)

+ 1 - 1
bin/genev/genevd/Makefile

@@ -4,7 +4,7 @@
 PREFIX = $(HOME)/.cargo
 PREFIX = $(HOME)/.cargo
 
 
 # Cargo binary
 # Cargo binary
-CARGO = cargo +nightly
+CARGO = cargo
 
 
 # Compile target
 # Compile target
 RUST_TARGET = $(shell rustc -Vv | grep '^host: ' | cut -d' ' -f2)
 RUST_TARGET = $(shell rustc -Vv | grep '^host: ' | cut -d' ' -f2)

+ 1 - 1
bin/lilith/Makefile

@@ -4,7 +4,7 @@
 PREFIX = $(HOME)/.cargo
 PREFIX = $(HOME)/.cargo
 
 
 # Cargo binary
 # Cargo binary
-CARGO = cargo +nightly
+CARGO = cargo
 
 
 # Compile target
 # Compile target
 RUST_TARGET = $(shell rustc -Vv | grep '^host: ' | cut -d' ' -f2)
 RUST_TARGET = $(shell rustc -Vv | grep '^host: ' | cut -d' ' -f2)

+ 1 - 1
bin/minerd/Makefile

@@ -4,7 +4,7 @@
 PREFIX = $(HOME)/.cargo
 PREFIX = $(HOME)/.cargo
 
 
 # Cargo binary
 # Cargo binary
-CARGO = cargo +nightly
+CARGO = cargo
 
 
 # Compile target
 # Compile target
 RUST_TARGET = $(shell rustc -Vv | grep '^host: ' | cut -d' ' -f2)
 RUST_TARGET = $(shell rustc -Vv | grep '^host: ' | cut -d' ' -f2)

+ 1 - 1
bin/tau/taud/Makefile

@@ -4,7 +4,7 @@
 PREFIX = $(HOME)/.cargo
 PREFIX = $(HOME)/.cargo
 
 
 # Cargo binary
 # Cargo binary
-CARGO = cargo +nightly
+CARGO = cargo
 
 
 # Compile target
 # Compile target
 RUST_TARGET = $(shell rustc -Vv | grep '^host: ' | cut -d' ' -f2)
 RUST_TARGET = $(shell rustc -Vv | grep '^host: ' | cut -d' ' -f2)

+ 1 - 1
bin/vanityaddr/Makefile

@@ -4,7 +4,7 @@
 PREFIX = $(HOME)/.cargo
 PREFIX = $(HOME)/.cargo
 
 
 # Cargo binary
 # Cargo binary
-CARGO = cargo +nightly
+CARGO = cargo
 
 
 # Compile target
 # Compile target
 RUST_TARGET = $(shell rustc -Vv | grep '^host: ' | cut -d' ' -f2)
 RUST_TARGET = $(shell rustc -Vv | grep '^host: ' | cut -d' ' -f2)

+ 1 - 1
bin/zkas/Makefile

@@ -4,7 +4,7 @@
 PREFIX = $(HOME)/.cargo
 PREFIX = $(HOME)/.cargo
 
 
 # Cargo binary
 # Cargo binary
-CARGO = cargo +nightly
+CARGO = cargo
 
 
 # Compile target
 # Compile target
 RUST_TARGET = $(shell rustc -Vv | grep '^host: ' | cut -d' ' -f2)
 RUST_TARGET = $(shell rustc -Vv | grep '^host: ' | cut -d' ' -f2)

+ 1 - 1
doc/src/dev/contrib/contrib.md

@@ -123,7 +123,7 @@ if there is a version mismatch.
 $ sh contrib/dependency_setup.sh
 $ sh contrib/dependency_setup.sh
 ```
 ```
 
 
-* Ensure that you are using the nightly toolchain and are building for `wasm32-unknown-unknown`.
+* Ensure that you are building for `wasm32-unknown-unknown`.
 Check `README.md` for instructions.
 Check `README.md` for instructions.
 
 
 * When running a `cargo` command, use the flag `--all-features`.
 * When running a `cargo` command, use the flag `--all-features`.

+ 9 - 5
doc/src/dev/dev.md

@@ -41,6 +41,10 @@ exit 0
 Inside the darkfi project repo, place this script in `.git/hooks/pre-commit`
 Inside the darkfi project repo, place this script in `.git/hooks/pre-commit`
 and make sure it's executable by running `chmod +x .git/hooks/pre-commit`.
 and make sure it's executable by running `chmod +x .git/hooks/pre-commit`.
 
 
+Code style formatting(rustfmt) requires a nightly rust toolchain. To install nightly toolchain, execute:
+```
+$ rustup toolchain install nightly
+```
 
 
 ## Testing crate features
 ## Testing crate features
 
 
@@ -101,8 +105,8 @@ binaries from our codebase. A short setup using a Debian system and
 ```
 ```
 
 
 Inside the container, once attached, we have to install the required
 Inside the container, once attached, we have to install the required
-dependencies. We will have to use `rustup` to get the latest rust
-nightly, and we also have to compile `sqlcipher` on our own.
+dependencies. We will have to use `rustup` to get the latest rust,
+and we also have to compile `sqlcipher` on our own.
 
 
 ```
 ```
 # apk add rustup git musl-dev make gcc openssl-dev openssl-libs-static tcl-dev zlib-static
 # apk add rustup git musl-dev make gcc openssl-dev openssl-libs-static tcl-dev zlib-static
@@ -113,9 +117,9 @@ nightly, and we also have to compile `sqlcipher` on our own.
 # make -j$(nproc)
 # make -j$(nproc)
 # make install
 # make install
 # cd ~
 # cd ~
-# rustup-init --default-toolchain nightly -y
+# rustup-init --default-toolchain stable -y
 # source ~/.cargo/env
 # source ~/.cargo/env
-# rustup target add wasm32-unknown-unknown --toolchain nightly
+# rustup target add wasm32-unknown-unknown --toolchain stable
 ```
 ```
 
 
 And now we should be able to build a statically linked binary:
 And now we should be able to build a statically linked binary:
@@ -134,7 +138,7 @@ In certain cases, it might also be possible to build natively by
 installing the musl toolchain:
 installing the musl toolchain:
 
 
 ```
 ```
-$ rustup target add x86_64-unknown-linux-musl --toolchain nightly
+$ rustup target add x86_64-unknown-linux-musl --toolchain stable
 ## Uncomment RUSTFLAGS in the main Makefile
 ## Uncomment RUSTFLAGS in the main Makefile
 $ sed -e 's,^#RUSTFLAGS ,RUSTFLAGS ,' -i Makefile
 $ sed -e 's,^#RUSTFLAGS ,RUSTFLAGS ,' -i Makefile
 $ make RUST_TARGET=x86_64-unknown-linux-musl darkirc
 $ make RUST_TARGET=x86_64-unknown-linux-musl darkirc

+ 1 - 6
doc/src/misc/network-troubleshooting.md

@@ -199,16 +199,11 @@ interacts within the network. dnet log information is created in
 You can ping any node to make sure it's online by using the provided
 You can ping any node to make sure it's online by using the provided
 `ping` tool located at `${DARKFI_REPO}/script/ping`. Select a peer from 
 `ping` tool located at `${DARKFI_REPO}/script/ping`. Select a peer from 
 your hostlist file. You can now use the `ping` tool by 
 your hostlist file. You can now use the `ping` tool by 
-running this command (assuming nightly is default):
+running this command:
 
 
 ```
 ```
 $ cargo run -- tcp+tls://example_peer:26661
 $ cargo run -- tcp+tls://example_peer:26661
 ```
 ```
-If nightly isn't default, use this command:
-
-```
-$ cargo +nightly run -- tcp+tls://example_peer:26661
-```
 
 
 If the peers are reachable, you'll receive a `Connected!` output.
 If the peers are reachable, you'll receive a `Connected!` output.
 
 

+ 1 - 1
example/wasm-hello-world/Makefile

@@ -1,7 +1,7 @@
 .POSIX:
 .POSIX:
 
 
 # Cargo binary
 # Cargo binary
-CARGO = cargo +nightly
+CARGO = cargo
 
 
 # wasm build target
 # wasm build target
 WASM_TARGET = wasm32-unknown-unknown
 WASM_TARGET = wasm32-unknown-unknown

+ 1 - 1
rust-toolchain.toml

@@ -1,2 +1,2 @@
 [toolchain]
 [toolchain]
-channel = "nightly"
+channel = "stable"

+ 1 - 1
script/evgrd/Makefile

@@ -1,7 +1,7 @@
 .POSIX:
 .POSIX:
 
 
 # Cargo binary
 # Cargo binary
-CARGO = cargo +nightly
+CARGO = cargo
 
 
 BIN = evgrd
 BIN = evgrd
 
 

+ 2 - 2
script/research/dam/dam-cli/Makefile

@@ -4,7 +4,7 @@
 PREFIX = $(HOME)/.cargo
 PREFIX = $(HOME)/.cargo
 
 
 # Cargo binary
 # Cargo binary
-CARGO = cargo +nightly
+CARGO = cargo
 
 
 # Compile target
 # Compile target
 RUST_TARGET = $(shell rustc -Vv | grep '^host: ' | cut -d' ' -f2)
 RUST_TARGET = $(shell rustc -Vv | grep '^host: ' | cut -d' ' -f2)
@@ -24,7 +24,7 @@ $(BIN): $(SRC)
 	cp -f target/$(RUST_TARGET)/release/$@ $@
 	cp -f target/$(RUST_TARGET)/release/$@ $@
 
 
 fmt:
 fmt:
-	$(CARGO) fmt --all
+	$(CARGO) +nightly fmt --all
 
 
 clippy:
 clippy:
 	RUSTFLAGS="$(RUSTFLAGS)" $(CARGO) clippy --target=$(RUST_TARGET) \
 	RUSTFLAGS="$(RUSTFLAGS)" $(CARGO) clippy --target=$(RUST_TARGET) \

+ 2 - 2
script/research/dam/damd/Makefile

@@ -4,7 +4,7 @@
 PREFIX = $(HOME)/.cargo
 PREFIX = $(HOME)/.cargo
 
 
 # Cargo binary
 # Cargo binary
-CARGO = cargo +nightly
+CARGO = cargo
 
 
 # Compile target
 # Compile target
 RUST_TARGET = $(shell rustc -Vv | grep '^host: ' | cut -d' ' -f2)
 RUST_TARGET = $(shell rustc -Vv | grep '^host: ' | cut -d' ' -f2)
@@ -24,7 +24,7 @@ $(BIN): $(SRC)
 	cp -f target/$(RUST_TARGET)/release/$@ $@
 	cp -f target/$(RUST_TARGET)/release/$@ $@
 
 
 fmt:
 fmt:
-	$(CARGO) fmt --all
+	$(CARGO) +nightly fmt --all
 
 
 clippy:
 clippy:
 	RUSTFLAGS="$(RUSTFLAGS)" $(CARGO) clippy --target=$(RUST_TARGET) \
 	RUSTFLAGS="$(RUSTFLAGS)" $(CARGO) clippy --target=$(RUST_TARGET) \

+ 2 - 2
script/research/gg/Makefile

@@ -4,7 +4,7 @@
 PREFIX = $(HOME)/.cargo
 PREFIX = $(HOME)/.cargo
 
 
 # Cargo binary
 # Cargo binary
-CARGO = cargo +nightly
+CARGO = cargo
 
 
 # Compile target
 # Compile target
 RUST_TARGET = $(shell rustc -Vv | grep '^host: ' | cut -d' ' -f2)
 RUST_TARGET = $(shell rustc -Vv | grep '^host: ' | cut -d' ' -f2)
@@ -24,7 +24,7 @@ $(BIN): $(SRC)
 	cp -f target/$(RUST_TARGET)/release/$@ $@
 	cp -f target/$(RUST_TARGET)/release/$@ $@
 
 
 fmt:
 fmt:
-	$(CARGO) fmt --all
+	$(CARGO) +nightly fmt --all
 
 
 clippy:
 clippy:
 	RUSTFLAGS="$(RUSTFLAGS)" $(CARGO) clippy --target=$(RUST_TARGET) \
 	RUSTFLAGS="$(RUSTFLAGS)" $(CARGO) clippy --target=$(RUST_TARGET) \

+ 1 - 1
script/research/rln/rlnv1/Makefile

@@ -1,7 +1,7 @@
 .POSIX:
 .POSIX:
 
 
 # Cargo binary
 # Cargo binary
-CARGO = cargo +nightly
+CARGO = cargo
 
 
 # Compile target
 # Compile target
 RUST_TARGET = $(shell rustc -Vv | grep '^host: ' | cut -d' ' -f2)
 RUST_TARGET = $(shell rustc -Vv | grep '^host: ' | cut -d' ' -f2)

+ 1 - 1
script/research/rln/rlnv2/Makefile

@@ -1,7 +1,7 @@
 .POSIX:
 .POSIX:
 
 
 # Cargo binary
 # Cargo binary
-CARGO = cargo +nightly
+CARGO = cargo
 
 
 # Compile target
 # Compile target
 RUST_TARGET = $(shell rustc -Vv | grep '^host: ' | cut -d' ' -f2)
 RUST_TARGET = $(shell rustc -Vv | grep '^host: ' | cut -d' ' -f2)

+ 1 - 1
src/contract/dao/Makefile

@@ -1,7 +1,7 @@
 .POSIX:
 .POSIX:
 
 
 # Cargo binary
 # Cargo binary
-CARGO = cargo +nightly
+CARGO = cargo
 
 
 # Compile target for system binaries
 # Compile target for system binaries
 RUST_TARGET = $(shell rustc -Vv | grep '^host: ' | cut -d' ' -f2)
 RUST_TARGET = $(shell rustc -Vv | grep '^host: ' | cut -d' ' -f2)

+ 1 - 1
src/contract/deployooor/Makefile

@@ -1,7 +1,7 @@
 .POSIX:
 .POSIX:
 
 
 # Cargo binary
 # Cargo binary
-CARGO = cargo +nightly
+CARGO = cargo
 
 
 # Compile target for system binaries
 # Compile target for system binaries
 RUST_TARGET = $(shell rustc -Vv | grep '^host: ' | cut -d' ' -f2)
 RUST_TARGET = $(shell rustc -Vv | grep '^host: ' | cut -d' ' -f2)

+ 1 - 1
src/contract/money/Makefile

@@ -1,7 +1,7 @@
 .POSIX:
 .POSIX:
 
 
 # Cargo binary
 # Cargo binary
-CARGO = cargo +nightly
+CARGO = cargo
 
 
 # Compile target for system binaries
 # Compile target for system binaries
 RUST_TARGET = $(shell rustc -Vv | grep '^host: ' | cut -d' ' -f2)
 RUST_TARGET = $(shell rustc -Vv | grep '^host: ' | cut -d' ' -f2)

+ 1 - 1
src/event_graph/tests.rs

@@ -16,7 +16,7 @@
  * along with this program.  If not, see <https://www.gnu.org/licenses/>.
  * along with this program.  If not, see <https://www.gnu.org/licenses/>.
  */
  */
 
 
-// cargo +nightly test --release --features=event-graph --lib eventgraph_propagation -- --include-ignored
+// cargo test --release --features=event-graph --lib eventgraph_propagation -- --include-ignored
 
 
 use std::sync::Arc;
 use std::sync::Arc;
 
 

+ 0 - 2
src/lib.rs

@@ -16,8 +16,6 @@
  * along with this program.  If not, see <https://www.gnu.org/licenses/>.
  * along with this program.  If not, see <https://www.gnu.org/licenses/>.
  */
  */
 
 
-#![feature(ip)]
-
 pub mod error;
 pub mod error;
 pub use error::{ClientFailed, ClientResult, Error, Result};
 pub use error::{ClientFailed, ClientResult, Error, Result};
 
 

+ 73 - 3
src/net/hosts.rs

@@ -23,7 +23,7 @@ use std::{
     collections::HashMap,
     collections::HashMap,
     fmt, fs,
     fmt, fs,
     fs::File,
     fs::File,
-    net::{IpAddr, Ipv6Addr},
+    net::{IpAddr, Ipv4Addr, Ipv6Addr},
     sync::{
     sync::{
         atomic::{AtomicBool, Ordering},
         atomic::{AtomicBool, Ordering},
         Arc, Mutex as SyncMutex, RwLock,
         Arc, Mutex as SyncMutex, RwLock,
@@ -1177,12 +1177,12 @@ impl Hosts {
         // Filter private IP ranges
         // Filter private IP ranges
         match url.host().unwrap() {
         match url.host().unwrap() {
             url::Host::Ipv4(ip) => {
             url::Host::Ipv4(ip) => {
-                if !ip.is_global() {
+                if !ip.unstable_is_global() {
                     return true
                     return true
                 }
                 }
             }
             }
             url::Host::Ipv6(ip) => {
             url::Host::Ipv6(ip) => {
-                if !ip.is_global() {
+                if !ip.unstable_is_global() {
                     return true
                     return true
                 }
                 }
             }
             }
@@ -1592,6 +1592,76 @@ impl Hosts {
     }
     }
 }
 }
 
 
+/// We need a convenience method from Rust's unstable feature "ip".
+/// When <https://github.com/rust-lang/rust/issues/27709> is stablized we can remove this.
+trait UnstableFeatureIp {
+    fn unstable_is_global(&self) -> bool;
+}
+
+impl UnstableFeatureIp for Ipv4Addr {
+    // Copied from: https://github.com/rust-lang/rust/blob/ea99e81485ff5d82cabba9af5d1c21293737cc16/library/core/src/net/ip_addr.rs#L839
+    #[inline]
+    fn unstable_is_global(&self) -> bool {
+        !(self.octets()[0] == 0 // "This network"
+            || self.is_private()
+            // is_shared https://github.com/rust-lang/rust/blob/ea99e81485ff5d82cabba9af5d1c21293737cc16/library/core/src/net/ip_addr.rs#L875
+            || self.octets()[0] == 100 && (self.octets()[1] & 0b1100_0000 == 0b0100_0000)
+            || self.is_loopback()
+            || self.is_link_local()
+            // addresses reserved for future protocols (`192.0.0.0/24`)
+            // .9 and .10 are documented as globally reachable so they're excluded
+            || (
+                self.octets()[0] == 192 && self.octets()[1] == 0 && self.octets()[2] == 0
+                && self.octets()[3] != 9 && self.octets()[3] != 10
+            )
+            || self.is_documentation()
+            // is_benchmarking https://github.com/rust-lang/rust/blob/ea99e81485ff5d82cabba9af5d1c21293737cc16/library/core/src/net/ip_addr.rs#L902
+            || self.octets()[0] == 198 && (self.octets()[1] & 0xfe) == 18
+            // is_reserved https://github.com/rust-lang/rust/blob/ea99e81485ff5d82cabba9af5d1c21293737cc16/library/core/src/net/ip_addr.rs#L938
+            || self.octets()[0] & 240 == 240 && !self.is_broadcast()
+            || self.is_broadcast())
+    }
+}
+
+impl UnstableFeatureIp for Ipv6Addr {
+    // Copied from: https://github.com/rust-lang/rust/blob/ea99e81485ff5d82cabba9af5d1c21293737cc16/library/core/src/net/ip_addr.rs#L1598
+    #[inline]
+    fn unstable_is_global(&self) -> bool {
+        !(self.is_unspecified()
+            || self.is_loopback()
+            // IPv4-mapped Address (`::ffff:0:0/96`)
+            || matches!(self.segments(), [0, 0, 0, 0, 0, 0xffff, _, _])
+            // IPv4-IPv6 Translat. (`64:ff9b:1::/48`)
+            || matches!(self.segments(), [0x64, 0xff9b, 1, _, _, _, _, _])
+            // Discard-Only Address Block (`100::/64`)
+            || matches!(self.segments(), [0x100, 0, 0, 0, _, _, _, _])
+            // IETF Protocol Assignments (`2001::/23`)
+            || (matches!(self.segments(), [0x2001, b, _, _, _, _, _, _] if b < 0x200)
+                && !(
+                    // Port Control Protocol Anycast (`2001:1::1`)
+                    u128::from_be_bytes(self.octets()) == 0x2001_0001_0000_0000_0000_0000_0000_0001
+                    // Traversal Using Relays around NAT Anycast (`2001:1::2`)
+                    || u128::from_be_bytes(self.octets()) == 0x2001_0001_0000_0000_0000_0000_0000_0002
+                    // AMT (`2001:3::/32`)
+                    || matches!(self.segments(), [0x2001, 3, _, _, _, _, _, _])
+                    // AS112-v6 (`2001:4:112::/48`)
+                    || matches!(self.segments(), [0x2001, 4, 0x112, _, _, _, _, _])
+                    // ORCHIDv2 (`2001:20::/28`)
+                    // Drone Remote ID Protocol Entity Tags (DETs) Prefix (`2001:30::/28`)`
+                    || matches!(self.segments(), [0x2001, b, _, _, _, _, _, _] if (0x20..=0x3F).contains(&b))
+                ))
+            // 6to4 (`2002::/16`) – it's not explicitly documented as globally reachable,
+            // IANA says N/A.
+            || matches!(self.segments(), [0x2002, _, _, _, _, _, _, _])
+            // is_documentation https://github.com/rust-lang/rust/blob/ea99e81485ff5d82cabba9af5d1c21293737cc16/library/core/src/net/ip_addr.rs#L1754
+            || matches!(self.segments(), [0x2001, 0xdb8, ..] | [0x3fff, 0..=0x0fff, ..])
+            // Segment Routing (SRv6) SIDs (`5f00::/16`)
+            || matches!(self.segments(), [0x5f00, ..])
+            || self.is_unique_local()
+            || self.is_unicast_link_local())
+    }
+}
+
 #[cfg(test)]
 #[cfg(test)]
 mod tests {
 mod tests {
     use super::*;
     use super::*;

+ 1 - 1
src/net/tests.rs

@@ -16,7 +16,7 @@
  * along with this program.  If not, see <https://www.gnu.org/licenses/>.
  * along with this program.  If not, see <https://www.gnu.org/licenses/>.
  */
  */
 
 
-// cargo +nightly test --release --features=net --lib p2p -- --include-ignored
+// cargo test --release --features=net --lib p2p -- --include-ignored
 
 
 use std::{collections::HashSet, net::TcpListener, panic, sync::Arc};
 use std::{collections::HashSet, net::TcpListener, panic, sync::Arc};