From e9ec67e78a062de9a90d76e77b4a8a9ecd1f9156 Mon Sep 17 00:00:00 2001 From: Michael Sproul Date: Tue, 10 Dec 2024 13:14:13 +1100 Subject: [PATCH 1/2] Fix Kurtosis, web3signer and cargo-audit for CI (#6671) * Update kurtosis-cli * Fix name of Kurtosis artefact used in doppelganger tests * Ignore idna vuln * Set Java Version to 21 (required since Web3Signer 24.12.0). --- .github/workflows/local-testnet.yml | 6 +++--- .github/workflows/test-suite.yml | 5 +++++ Makefile | 2 +- scripts/tests/doppelganger_protection.sh | 4 ++-- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/.github/workflows/local-testnet.yml b/.github/workflows/local-testnet.yml index d496cc6348e..1cd2f24548e 100644 --- a/.github/workflows/local-testnet.yml +++ b/.github/workflows/local-testnet.yml @@ -40,7 +40,7 @@ jobs: run: | echo "deb [trusted=yes] https://apt.fury.io/kurtosis-tech/ /" | sudo tee /etc/apt/sources.list.d/kurtosis.list sudo apt update - sudo apt install -y kurtosis-cli=1.3.1 + sudo apt install -y kurtosis-cli kurtosis analytics disable - name: Download Docker image artifact @@ -86,7 +86,7 @@ jobs: run: | echo "deb [trusted=yes] https://apt.fury.io/kurtosis-tech/ /" | sudo tee /etc/apt/sources.list.d/kurtosis.list sudo apt update - sudo apt install -y kurtosis-cli=1.3.1 + sudo apt install -y kurtosis-cli kurtosis analytics disable - name: Download Docker image artifact @@ -121,7 +121,7 @@ jobs: run: | echo "deb [trusted=yes] https://apt.fury.io/kurtosis-tech/ /" | sudo tee /etc/apt/sources.list.d/kurtosis.list sudo apt update - sudo apt install -y kurtosis-cli=1.3.1 + sudo apt install -y kurtosis-cli kurtosis analytics disable - name: Download Docker image artifact diff --git a/.github/workflows/test-suite.yml b/.github/workflows/test-suite.yml index d6ef1809341..8da46ed8eea 100644 --- a/.github/workflows/test-suite.yml +++ b/.github/workflows/test-suite.yml @@ -83,6 +83,11 @@ jobs: runs-on: ${{ github.repository == 'sigp/lighthouse' && fromJson('["self-hosted", "linux", "CI", "large"]') || 'ubuntu-latest' }} steps: - uses: actions/checkout@v4 + # Set Java version to 21. (required since Web3Signer 24.12.0). + - uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: '21' - name: Get latest version of stable Rust if: env.SELF_HOSTED_RUNNERS == 'false' uses: moonrepo/setup-rust@v1 diff --git a/Makefile b/Makefile index fd7d45f26a0..ab239c94d33 100644 --- a/Makefile +++ b/Makefile @@ -240,7 +240,7 @@ install-audit: cargo install --force cargo-audit audit-CI: - cargo audit + cargo audit --ignore RUSTSEC-2024-0421 # Runs `cargo vendor` to make sure dependencies can be vendored for packaging, reproducibility and archival purpose. vendor: diff --git a/scripts/tests/doppelganger_protection.sh b/scripts/tests/doppelganger_protection.sh index 441e2a63575..5be5c13dee9 100755 --- a/scripts/tests/doppelganger_protection.sh +++ b/scripts/tests/doppelganger_protection.sh @@ -71,7 +71,7 @@ if [[ "$BEHAVIOR" == "failure" ]]; then # This process should not last longer than 2 epochs vc_1_range_start=0 vc_1_range_end=$(($KEYS_PER_NODE - 1)) - vc_1_keys_artifact_id="1-lighthouse-geth-$vc_1_range_start-$vc_1_range_end-0" + vc_1_keys_artifact_id="1-lighthouse-geth-$vc_1_range_start-$vc_1_range_end" service_name=vc-1-doppelganger kurtosis service add \ @@ -107,7 +107,7 @@ if [[ "$BEHAVIOR" == "success" ]]; then vc_4_range_start=$(($KEYS_PER_NODE * 3)) vc_4_range_end=$(($KEYS_PER_NODE * 4 - 1)) - vc_4_keys_artifact_id="4-lighthouse-geth-$vc_4_range_start-$vc_4_range_end-0" + vc_4_keys_artifact_id="4-lighthouse-geth-$vc_4_range_start-$vc_4_range_end" service_name=vc-4 kurtosis service add \ From 3b8254a8ecbe78eae659f1b3cfdfca78b02a5ad0 Mon Sep 17 00:00:00 2001 From: Age Manning Date: Tue, 10 Dec 2024 15:24:55 +1100 Subject: [PATCH 2/2] Correct flakey CI tests (#6646) * Correct flakey CI tests * Correct clippy * Extend timeout for events --- beacon_node/network/src/subnet_service/mod.rs | 1 + beacon_node/network/src/subnet_service/tests/mod.rs | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/beacon_node/network/src/subnet_service/mod.rs b/beacon_node/network/src/subnet_service/mod.rs index ab73b6ad9c4..ec6f3b10a38 100644 --- a/beacon_node/network/src/subnet_service/mod.rs +++ b/beacon_node/network/src/subnet_service/mod.rs @@ -213,6 +213,7 @@ impl SubnetService { #[cfg(test)] pub(crate) fn is_subscribed(&self, subnet: &Subnet) -> bool { self.subscriptions.contains_key(subnet) + || self.permanent_attestation_subscriptions.contains(subnet) } /// Processes a list of validator subscriptions. diff --git a/beacon_node/network/src/subnet_service/tests/mod.rs b/beacon_node/network/src/subnet_service/tests/mod.rs index c56079b9ac8..91e4841b264 100644 --- a/beacon_node/network/src/subnet_service/tests/mod.rs +++ b/beacon_node/network/src/subnet_service/tests/mod.rs @@ -225,7 +225,7 @@ mod test { let mut committee_count = 1; let mut subnet = Subnet::Attestation( SubnetId::compute_subnet::( - current_slot, + subscription_slot, committee_index, committee_count, &subnet_service.beacon_chain.spec, @@ -250,7 +250,7 @@ mod test { let subscriptions = vec![get_subscription( committee_index, - current_slot, + subscription_slot, committee_count, true, )]; @@ -556,7 +556,8 @@ mod test { subnet_service.validator_subscriptions(vec![sub1, sub2].into_iter()); // Unsubscription event should happen at the end of the slot. - let events = get_events(&mut subnet_service, None, 1).await; + // We wait for 2 slots, to avoid timeout issues + let events = get_events(&mut subnet_service, None, 2).await; let expected_subscription = SubnetServiceMessage::Subscribe(Subnet::Attestation(subnet_id1)); @@ -567,6 +568,7 @@ mod test { assert_eq!(expected_subscription, events[0]); assert_eq!(expected_unsubscription, events[2]); } + // Check that there are no more subscriptions assert_eq!(subnet_service.subscriptions().count(), 0); println!("{events:?}");