diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index 0e8238f..f139980 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -1,46 +1,55 @@ +name: Codecov + on: pull_request: push: branches: - master -name: Codecov - jobs: test: name: Test - env: - RUSTFLAGS: -C instrument-coverage runs-on: ubuntu-latest + env: + RUSTFLAGS: "-C instrument-coverage -C force-frame-pointers=yes -C no-stack-check" + steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: true + - name: Checkout submodules run: git submodule update --init --recursive - - uses: actions/setup-go@v3 # we need go to build go-waku - with: - go-version: '1.20' - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - override: true - components: llvm-tools-preview - - uses: actions-rs/cargo@v1 - continue-on-error: true - - run: | - cargo install grcov; + + - name: Install stable toolchain + uses: dtolnay/rust-toolchain@stable + + - uses: Swatinem/rust-cache@v2 + + - name: Install llvm-tools and grcov + run: | + rustup component add llvm-tools-preview + cargo install grcov + + - name: Install dependencies + run: | + sudo apt-get install -y cmake ninja-build binaryen; + cargo install wasm-pack --version=0.13.1; + + - name: Clean previous builds + run: cargo clean + + - name: Run tests and generate coverage report + run: | cargo test --all-features; cargo test discv5_echo -- --ignored; cargo test default_echo -- --ignored; - mkdir /tmp/cov; - grcov . --binary-path ./target/debug/ -s . -t lcov --branch --ignore-not-existing --ignore '../*' --ignore "/*" -o /tmp/cov/tests.lcov; - - uses: codecov/codecov-action@v3 - with: - token: ${{ secrets.CODECOV_TOKEN }} - directory: /tmp/cov/ - name: waku-bindings-codecov - fail_ci_if_error: true - + # mkdir /tmp/cov; + # grcov . --binary-path ./target/debug/ -s . -t lcov --branch --ignore-not-existing --ignore '../*' --ignore "/*" -o /tmp/cov/tests.lcov; + # - uses: codecov/codecov-action@v4 + # with: + # token: ${{ secrets.CODECOV_TOKEN }} + # files: /tmp/cov/tests.lcov + # name: waku-bindings-codecov + # fail_ci_if_error: true diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 72f97de..2143c4b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -8,6 +8,22 @@ on: name: CI +# Make sure cc linker is used on Linux/macOS +x-setup-linker: &setup-linker + - name: Setup linker + run: | + mkdir -p .cargo + cat > .cargo/config.toml < eframe::Result<()> { tcp_port: Some(60010), cluster_id: Some(16), shards: vec![1, 32, 64, 128, 256], + num_shards_in_network: Some(257), // node_key: Some(SecretKey::from_str("2fc0515879e52b7b73297cfd6ab3abf7c344ef84b7a90ff6f4cc19e05a198027").unwrap()), max_message_size: Some("1024KiB".to_string()), relay_topics: vec![String::from(&game_topic)], diff --git a/examples/toy-chat/src/main.rs b/examples/toy-chat/src/main.rs index e5890fd..1de0615 100644 --- a/examples/toy-chat/src/main.rs +++ b/examples/toy-chat/src/main.rs @@ -55,6 +55,7 @@ impl App { tcp_port: Some(60010), cluster_id: Some(16), shards: vec![1, 32, 64, 128, 256], + num_shards_in_network: Some(257), // node_key: Some(SecretKey::from_str("2fc0515879e52b7b73297cfd6ab3abf7c344ef84b7a90ff6f4cc19e05a198027").unwrap()), max_message_size: Some("1024KiB".to_string()), relay_topics: vec![String::from(&pubsub_topic)], diff --git a/waku-bindings/Cargo.toml b/waku-bindings/Cargo.toml index acfc7b0..6d6d544 100644 --- a/waku-bindings/Cargo.toml +++ b/waku-bindings/Cargo.toml @@ -31,7 +31,7 @@ url = "2.3" waku-sys = { version = "1.0.0", path = "../waku-sys" } libc = "0.2" serde-aux = "4.3.1" -rln = "0.3.4" +rln = "0.8.0" tokio = { version = "1", features = ["full"] } regex = "1" chrono = "0.4" diff --git a/waku-bindings/src/node/config.rs b/waku-bindings/src/node/config.rs index 6bf5fb0..e26a87e 100644 --- a/waku-bindings/src/node/config.rs +++ b/waku-bindings/src/node/config.rs @@ -28,8 +28,11 @@ pub struct WakuNodeConfig { #[default(Some(true))] pub relay: Option, pub relay_topics: Vec, - #[default(vec![1])] + #[default(vec![0])] pub shards: Vec, + #[default(Some(1))] + #[serde(rename = "numShardsInNetwork")] + pub num_shards_in_network: Option, #[serde(skip_serializing_if = "Option::is_none")] pub max_message_size: Option, diff --git a/waku-sys/vendor b/waku-sys/vendor index 4117449..25e1a15 160000 --- a/waku-sys/vendor +++ b/waku-sys/vendor @@ -1 +1 @@ -Subproject commit 4117449b9af6c0304a6115dd4bc0d1d745159685 +Subproject commit 25e1a15a83b2030d66d97a63eb756cd13340cb9a