Skip to content
Merged
5 changes: 5 additions & 0 deletions .cargo/audit.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[advisories]
# protobuf 2.28.0 (via prometheus 0.13.4) - crash due to uncontrolled recursion.
# Not exploitable in our context: protobuf is only used for Prometheus metrics
# serialization with trusted internal data, not for parsing untrusted input.
ignore = ["RUSTSEC-2024-0437"]
6 changes: 6 additions & 0 deletions .github/workflows/test-suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ env:
CARGO_INCREMENTAL: 0
# Enable portable to prevent issues with caching `blst` for the wrong CPU type
TEST_FEATURES: portable
# Use Clang for C/C++ compilation. Required because leveldb-sys uses
# -Wthread-safety which is a Clang-only flag unsupported by GCC.
CC: clang
CXX: clang++
jobs:
check-labels:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -96,6 +100,8 @@ jobs:
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly-ca67d15f4abd46394b324c50e21e66f306a1162d
- name: Clear stale leveldb-sys cmake cache
run: rm -rf target/release/build/leveldb-sys-*/out/build 2>/dev/null || true
- name: Run tests in release
run: make test-release
- name: Show cache stats
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/zkboost-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ env:
RUSTFLAGS: "-D warnings -C debuginfo=0"
CARGO_INCREMENTAL: 0
TEST_FEATURES: portable
# Use Clang for C/C++ compilation. Required because leveldb-sys uses
# -Wthread-safety which is a Clang-only flag unsupported by GCC.
CC: clang
CXX: clang++

jobs:
check-labels:
Expand Down Expand Up @@ -52,6 +56,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Install dependencies
run: sudo apt update && sudo apt install -y git gcc g++ make cmake pkg-config llvm-dev libclang-dev clang
- name: Get latest version of stable Rust
uses: moonrepo/setup-rust@v1
with:
Expand All @@ -60,5 +66,7 @@ jobs:
bins: cargo-nextest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Clear stale leveldb-sys cmake cache
run: rm -rf target/release/build/leveldb-sys-*/out/build 2>/dev/null || true
- name: Run proof_engine_zkboost integration tests
run: make test-zkboost
5 changes: 4 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
FROM rust:1.91.0-bullseye AS builder
RUN apt-get update && apt-get -y upgrade && apt-get install -y cmake libclang-dev
RUN apt-get update && apt-get -y upgrade && apt-get install -y cmake libclang-dev clang
ARG FEATURES
ARG PROFILE=release
ARG CARGO_USE_GIT_CLI=true
ENV FEATURES=$FEATURES
ENV PROFILE=$PROFILE
ENV CARGO_NET_GIT_FETCH_WITH_CLI=$CARGO_USE_GIT_CLI
ENV CARGO_INCREMENTAL=1
# Use Clang for C/C++ compilation (leveldb-sys requires -Wthread-safety, a Clang-only flag)
ENV CC=clang
ENV CXX=clang++

WORKDIR /lighthouse
COPY . .
Expand Down
7 changes: 1 addition & 6 deletions beacon_node/beacon_chain/src/test_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -804,12 +804,7 @@ where
pub fn shutdown_reasons(&self) -> Vec<ShutdownReason> {
let mutex = self.shutdown_receiver.clone();
let mut receiver = mutex.lock();
std::iter::from_fn(move || match receiver.try_next() {
Ok(Some(s)) => Some(s),
Ok(None) => panic!("shutdown sender dropped"),
Err(_) => None,
})
.collect()
std::iter::from_fn(move || receiver.try_recv().ok()).collect()
}

pub fn get_current_state(&self) -> BeaconState<E> {
Expand Down
3 changes: 1 addition & 2 deletions consensus/fork_choice/tests/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,7 @@ impl ForkChoiceTest {
let mut shutdown_receiver = mutex.lock();

shutdown_receiver.close();
let msg = shutdown_receiver.try_next().unwrap();
msg.is_some()
shutdown_receiver.try_recv().is_ok()
}

/// Assert there was a shutdown signal sent by the beacon chain.
Expand Down
14 changes: 9 additions & 5 deletions deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,26 @@
multiple-versions = "allow"
deny = [
{ crate = "ethers", reason = "legacy Ethereum crate, use alloy instead" },
{ crate = "ethereum-types", reason = "legacy Ethereum crate, use alloy-primitives instead" },
{ crate = "protobuf", reason = "use quick-protobuf instead" },
{ crate = "derivative", reason = "use educe or derive_more instead" },
{ crate = "ark-ff", reason = "present in Cargo.lock but not needed by Lighthouse" },
{ crate = "strum", deny-multiple-versions = true, reason = "takes a long time to compile" },
{ crate = "reqwest", deny-multiple-versions = true, reason = "takes a long time to compile" },
{ crate = "aes", deny-multiple-versions = true, reason = "takes a long time to compile" },
{ crate = "sha2", deny-multiple-versions = true, reason = "takes a long time to compile" },
{ crate = "pbkdf2", deny-multiple-versions = true, reason = "takes a long time to compile" },
{ crate = "scrypt", deny-multiple-versions = true, reason = "takes a long time to compile" },
]
# Crates banned upstream but required by zkboost/ethrex transitive dependencies
skip = [
{ crate = "ethereum-types@0.15.1", reason = "transitive dep of ethrex (zkboost)" },
{ crate = "protobuf@2.28.0", reason = "transitive dep via prometheus (zkboost)" },
{ crate = "protobuf@3.7.2", reason = "transitive dep of ethrex (zkboost)" },
{ crate = "derivative@2.2.0", reason = "transitive dep of ethrex (zkboost)" },
{ crate = "ark-ff", reason = "transitive dep of ethrex-levm (zkboost)" },
]

[sources]
unknown-registry = "deny"
unknown-git = "warn"
allow-registry = ["https://github.com/rust-lang/crates.io-index"]

[sources.allow-org]
github = ["sigp"]
github = ["sigp", "lambdaclass", "eth-act", "paradigmxyz", "frisitano"]
3 changes: 3 additions & 0 deletions testing/proof_engine_zkboost/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ name = "proof_engine_zkboost_test"
version = "0.1.0"
edition.workspace = true

[features]
portable = ["types/portable"]

[dependencies]
anyhow = { workspace = true }
axum = { workspace = true }
Expand Down
Loading