Merge branch 'master' into improve-makefile

This commit is contained in:
stubbsta 2026-05-22 10:27:14 +02:00
commit 914c32b5d8
No known key found for this signature in database
4 changed files with 56 additions and 30 deletions

View File

@ -74,35 +74,14 @@
let
pkgs = pkgsFor system;
# zerokit's nix/default.nix hardcodes a cargoHash that is stale for
# our pinned nixpkgs on a cold runner (the status.im substituter is
# untrusted here, so the cargo-vendor FOD is recomputed). v2.0.2 did
# NOT fix this for consumers — its committed hash is the old v2.0.1
# value while v2.0.2's Cargo.lock changed. Rebuild librln here from
# the pinned zerokit source with the correct cargoHash. Keep the
# version + cargoHash in sync with the zerokit input rev.
rustToolchain = pkgs.rust-bin.stable.latest.default;
zerokitRln = pkgs.rustPlatform.buildRustPackage {
pname = "zerokit";
version = "2.0.2";
src = zerokit;
cargo = rustToolchain;
rustc = rustToolchain;
cargoHash = "sha256-PNwEdZLgGQPqQDrEK2hsQtSybVfBbD6xn4K47fPFJUU=";
nativeBuildInputs = [ pkgs.rust-cbindgen ];
doCheck = false;
buildPhase = ''
export CARGO_HOME=$TMPDIR/cargo
cargo build --lib --release --manifest-path rln/Cargo.toml
'';
installPhase = ''
set -eu
mkdir -p $out/lib $out/include
find target -type f -name 'librln.*' -not -path '*/deps/*' \
-exec cp -v '{}' "$out/lib/" \;
cbindgen ./rln -l c > "$out/include/rln.h"
'';
};
# HACK: Fix for stale cargoHash in 2.0.2 release.
zerokitRln = zerokit.packages.${system}.rln.overrideAttrs (old: {
cargoDeps = old.cargoDeps.overrideAttrs (oldCargoDeps: {
vendorStaging = oldCargoDeps.vendorStaging.overrideAttrs (_: {
outputHash = "sha256-PNwEdZLgGQPqQDrEK2hsQtSybVfBbD6xn4K47fPFJUU=";
});
});
});
liblogosdelivery = pkgs.callPackage ./nix/default.nix {
inherit pkgs;

View File

@ -219,6 +219,22 @@ suite "WakuNodeConf - preset integration":
check:
wakuConf.clusterId == 2
test "LogosTest preset applies LogosTestConf":
## Given
var conf = defaultWakuNodeConf().valueOr:
raiseAssert error
conf.preset = "logostest"
## When
let wakuConfRes = conf.toWakuConf()
## Then
require wakuConfRes.isOk()
let wakuConf = wakuConfRes.get()
require wakuConf.validate().isOk()
check:
wakuConf.clusterId == 2
test "Invalid preset returns error":
## Given
var conf = defaultWakuNodeConf().valueOr:

View File

@ -165,7 +165,7 @@ type WakuNodeConf* = object
preset* {.
desc:
"Network preset to use. 'twn' is The RLN-protected Waku Network (cluster 1). 'logos.dev' is the Logos Dev Network (cluster 2). Overrides other values.",
"Network preset to use. 'twn' is The RLN-protected Waku Network (cluster 1). 'logos.dev' is the Logos Dev Network (cluster 2). 'logos.test' is the Logos Test Network (cluster 2). Overrides other values.",
defaultValue: "",
name: "preset"
.}: string
@ -947,6 +947,8 @@ proc toNetworkConf(
ok(some(NetworkConf.TheWakuNetworkConf()))
of "logos.dev", "logosdev":
ok(some(NetworkConf.LogosDevConf()))
of "logos.test", "logostest":
ok(some(NetworkConf.LogosTestConf()))
else:
err("Invalid --preset value passed: " & lcPreset)

View File

@ -92,6 +92,35 @@ proc LogosDevConf*(T: type NetworkConf): NetworkConf =
],
)
# cluster-id=2 (Logos Test Network)
# Cluster configuration for the Logos Test Network.
proc LogosTestConf*(T: type NetworkConf): NetworkConf =
const ZeroChainId = 0'u256
return NetworkConf(
maxMessageSize: "150KiB",
clusterId: 2,
rlnRelay: false,
rlnRelayEthContractAddress: "",
rlnRelayDynamic: false,
rlnRelayChainId: ZeroChainId,
rlnEpochSizeSec: 0,
rlnRelayUserMessageLimit: 0,
shardingConf: ShardingConf(kind: AutoSharding, numShardsInCluster: 8),
enableKadDiscovery: true,
mix: true,
p2pReliability: true,
discv5Discovery: true,
discv5BootstrapNodes: @[],
entryNodes: @[
"/dns4/node-01.do-ams3.logos.test.status.im/tcp/30303/p2p/16Uiu2HAmQ9X2xDfPG3uL77V9piYDhjq14JhKCtcmNYsTMKNqrKCj",
"/dns4/node-02.do-ams3.logos.test.status.im/tcp/30303/p2p/16Uiu2HAmB8NYprrfQrgWVzsJtYWkfjsXbmJEGNMG6othXsQ53BwG",
"/dns4/node-01.gc-us-central1-a.logos.test.status.im/tcp/30303/p2p/16Uiu2HAmF8WtwGPmeGHgYAX2277jHgy5cW9F7zsB8EqUjBZQAZQ3",
"/dns4/node-02.gc-us-central1-a.logos.test.status.im/tcp/30303/p2p/16Uiu2HAmUuXhUW9bdJpzN1kfDziFiUZo4bszTk66cvr7uuyCHXR7",
"/dns4/node-01.ac-cn-hongkong-c.logos.test.status.im/tcp/30303/p2p/16Uiu2HAmL3oU95jh1BZHozn3uNhx8HEneirgr8M1jEAapzXGDqRF",
"/dns4/node-02.ac-cn-hongkong-c.logos.test.status.im/tcp/30303/p2p/16Uiu2HAm28CoBZjpyxsanC8tQpbvZ7bZJnVYuB1EgFzb571qpWsV",
],
)
proc validateShards*(
shardingConf: ShardingConf, shards: seq[uint16]
): Result[void, string] =