Skip to content

Commit

Permalink
Merge branch 'unstable' into das
Browse files Browse the repository at this point in the history
# Conflicts:
#	.github/workflows/test-suite.yml
#	beacon_node/network/src/sync/block_lookups/mod.rs
#	beacon_node/network/src/sync/block_lookups/single_block_lookup.rs
#	beacon_node/network/src/sync/network_context.rs
  • Loading branch information
jimmygchen committed May 17, 2024
2 parents 8059c3a + 8006418 commit e6f17d3
Show file tree
Hide file tree
Showing 11 changed files with 279 additions and 203 deletions.
131 changes: 96 additions & 35 deletions .github/workflows/test-suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,31 @@ env:
# Enable portable to prevent issues with caching `blst` for the wrong CPU type
TEST_FEATURES: portable
jobs:
check-labels:
runs-on: ubuntu-latest
name: Check for 'skip-ci' label
outputs:
skip_ci: ${{ steps.set-output.outputs.SKIP_CI }}
steps:
- name: check for skip-ci label
id: set-output
env:
LABELS: ${{ toJson(github.event.pull_request.labels) }}
run: |
SKIP_CI="false"
if [ -z "${LABELS}" ]; then
LABELS="none";
else
LABELS=$(echo ${LABELS} | jq -r '.[].name')
fi
for label in ${LABELS}; do
if [ "$label" = "skip-ci" ]; then
SKIP_CI="true"
break
fi
done
echo "::set-output name=skip_ci::$SKIP_CI"
target-branch-check:
name: target-branch-check
runs-on: ubuntu-latest
Expand All @@ -38,6 +63,8 @@ jobs:
run: test ${{ github.base_ref }} != "stable"
release-tests-ubuntu:
name: release-tests-ubuntu
needs: [check-labels]
if: needs.check-labels.outputs.skip_ci != 'true'
# Use self-hosted runners only on the sigp repo.
runs-on: ${{ github.repository == 'sigp/lighthouse' && fromJson('["self-hosted", "linux", "CI", "large"]') || 'ubuntu-latest' }}
steps:
Expand All @@ -61,43 +88,47 @@ jobs:
- name: Show cache stats
if: env.SELF_HOSTED_RUNNERS == 'true'
run: sccache --show-stats
# FIXME(das): disabled for now as the c-kzg-4844 `das` branch doesn't build on windows.
# release-tests-windows:
# name: release-tests-windows
# runs-on: ${{ github.repository == 'sigp/lighthouse' && fromJson('["self-hosted", "windows", "CI"]') || 'windows-2019' }}
# steps:
# - uses: actions/checkout@v4
# - name: Get latest version of stable Rust
# if: env.SELF_HOSTED_RUNNERS == 'false'
# uses: moonrepo/setup-rust@v1
# with:
# channel: stable
# cache-target: release
# bins: cargo-nextest
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# - name: Install Foundry (anvil)
# if: env.SELF_HOSTED_RUNNERS == 'false'
# uses: foundry-rs/foundry-toolchain@v1
# with:
# version: nightly-ca67d15f4abd46394b324c50e21e66f306a1162d
# - name: Install make
# if: env.SELF_HOSTED_RUNNERS == 'false'
# run: choco install -y make
## - uses: KyleMayes/install-llvm-action@v1
## if: env.SELF_HOSTED_RUNNERS == 'false'
## with:
## version: "16.0"
## directory: ${{ runner.temp }}/llvm
# - name: Set LIBCLANG_PATH
# run: echo "LIBCLANG_PATH=$((gcm clang).source -replace "clang.exe")" >> $env:GITHUB_ENV
# - name: Run tests in release
# run: make nextest-release
# - name: Show cache stats
# if: env.SELF_HOSTED_RUNNERS == 'true'
# run: sccache --show-stats
# FIXME(das): disabled for now as the c-kzg-4844 `das` branch doesn't build on windows.
# release-tests-windows:
# name: release-tests-windows
# needs: [check-labels]
# if: needs.check-labels.outputs.skip_ci != 'true'
# runs-on: ${{ github.repository == 'sigp/lighthouse' && fromJson('["self-hosted", "windows", "CI"]') || 'windows-2019' }}
# steps:
# - uses: actions/checkout@v4
# - name: Get latest version of stable Rust
# if: env.SELF_HOSTED_RUNNERS == 'false'
# uses: moonrepo/setup-rust@v1
# with:
# channel: stable
# cache-target: release
# bins: cargo-nextest
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# - name: Install Foundry (anvil)
# if: env.SELF_HOSTED_RUNNERS == 'false'
# uses: foundry-rs/foundry-toolchain@v1
# with:
# version: nightly-ca67d15f4abd46394b324c50e21e66f306a1162d
# - name: Install make
# if: env.SELF_HOSTED_RUNNERS == 'false'
# run: choco install -y make
## - uses: KyleMayes/install-llvm-action@v1
## if: env.SELF_HOSTED_RUNNERS == 'false'
## with:
## version: "16.0"
## directory: ${{ runner.temp }}/llvm
# - name: Set LIBCLANG_PATH
# run: echo "LIBCLANG_PATH=$((gcm clang).source -replace "clang.exe")" >> $env:GITHUB_ENV
# - name: Run tests in release
# run: make nextest-release
# - name: Show cache stats
# if: env.SELF_HOSTED_RUNNERS == 'true'
# run: sccache --show-stats
beacon-chain-tests:
name: beacon-chain-tests
needs: [check-labels]
if: needs.check-labels.outputs.skip_ci != 'true'
# Use self-hosted runners only on the sigp repo.
runs-on: ${{ github.repository == 'sigp/lighthouse' && fromJson('["self-hosted", "linux", "CI", "large"]') || 'ubuntu-latest' }}
env:
Expand All @@ -118,6 +149,8 @@ jobs:
run: sccache --show-stats
op-pool-tests:
name: op-pool-tests
needs: [check-labels]
if: needs.check-labels.outputs.skip_ci != 'true'
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -133,6 +166,8 @@ jobs:
run: make test-op-pool
network-tests:
name: network-tests
needs: [check-labels]
if: needs.check-labels.outputs.skip_ci != 'true'
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -148,6 +183,8 @@ jobs:
run: make test-network
slasher-tests:
name: slasher-tests
needs: [check-labels]
if: needs.check-labels.outputs.skip_ci != 'true'
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -163,6 +200,8 @@ jobs:
run: make test-slasher
debug-tests-ubuntu:
name: debug-tests-ubuntu
needs: [check-labels]
if: needs.check-labels.outputs.skip_ci != 'true'
# Use self-hosted runners only on the sigp repo.
runs-on: ${{ github.repository == 'sigp/lighthouse' && fromJson('["self-hosted", "linux", "CI", "large"]') || 'ubuntu-latest' }}
env:
Expand All @@ -187,6 +226,8 @@ jobs:
run: sccache --show-stats
state-transition-vectors-ubuntu:
name: state-transition-vectors-ubuntu
needs: [check-labels]
if: needs.check-labels.outputs.skip_ci != 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -199,6 +240,8 @@ jobs:
run: make run-state-transition-tests
ef-tests-ubuntu:
name: ef-tests-ubuntu
needs: [check-labels]
if: needs.check-labels.outputs.skip_ci != 'true'
# Use self-hosted runners only on the sigp repo.
runs-on: ${{ github.repository == 'sigp/lighthouse' && fromJson('["self-hosted", "linux", "CI", "small"]') || 'ubuntu-latest' }}
env:
Expand All @@ -219,6 +262,8 @@ jobs:
run: sccache --show-stats
dockerfile-ubuntu:
name: dockerfile-ubuntu
needs: [check-labels]
if: needs.check-labels.outputs.skip_ci != 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -228,6 +273,8 @@ jobs:
run: docker run -t lighthouse:local lighthouse --version
basic-simulator-ubuntu:
name: basic-simulator-ubuntu
needs: [check-labels]
if: needs.check-labels.outputs.skip_ci != 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -240,6 +287,8 @@ jobs:
run: cargo run --release --bin simulator basic-sim
fallback-simulator-ubuntu:
name: fallback-simulator-ubuntu
needs: [check-labels]
if: needs.check-labels.outputs.skip_ci != 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -252,6 +301,8 @@ jobs:
run: cargo run --release --bin simulator fallback-sim
doppelganger-protection-test:
name: doppelganger-protection-test
needs: [check-labels]
if: needs.check-labels.outputs.skip_ci != 'true'
runs-on: ${{ github.repository == 'sigp/lighthouse' && fromJson('["self-hosted", "linux", "CI", "small"]') || 'ubuntu-latest' }}
env:
# Enable portable to prevent issues with caching `blst` for the wrong CPU type
Expand Down Expand Up @@ -286,6 +337,8 @@ jobs:
./doppelganger_protection.sh success genesis.json
execution-engine-integration-ubuntu:
name: execution-engine-integration-ubuntu
needs: [check-labels]
if: needs.check-labels.outputs.skip_ci != 'true'
runs-on: ${{ github.repository == 'sigp/lighthouse' && fromJson('["self-hosted", "linux", "CI", "small"]') || 'ubuntu-latest' }}
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -345,6 +398,8 @@ jobs:
run: cargo check --workspace
cargo-udeps:
name: cargo-udeps
needs: [check-labels]
if: needs.check-labels.outputs.skip_ci != 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -367,6 +422,8 @@ jobs:
RUSTFLAGS: ""
compile-with-beta-compiler:
name: compile-with-beta-compiler
needs: [check-labels]
if: needs.check-labels.outputs.skip_ci != 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -378,6 +435,8 @@ jobs:
run: make
cli-check:
name: cli-check
needs: [check-labels]
if: needs.check-labels.outputs.skip_ci != 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -392,8 +451,10 @@ jobs:
# a PR is safe to merge. New jobs should be added here.
test-suite-success:
name: test-suite-success
if: needs.check-labels.outputs.skip_ci != 'true'
runs-on: ubuntu-latest
needs: [
'check-labels',
'target-branch-check',
'release-tests-ubuntu',
# FIXME(das): disabled for now as the c-kzg-4844 `das` branch doesn't build on windows.
Expand Down
10 changes: 1 addition & 9 deletions beacon_node/http_api/src/publish_blocks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -273,15 +273,7 @@ pub async fn publish_block<T: BeaconChainTypes, B: IntoGossipVerifiedBlockConten
}

if let Some(gossip_verified_data_columns) = gossip_verified_data_columns {
let custody_columns_indices =
network_globals
.custody_columns(block.epoch())
.map_err(|e| {
warp_utils::reject::broadcast_without_import(format!(
"Failed to compute custody column indices: {:?}",
e
))
})?;
let custody_columns_indices = network_globals.custody_columns(block.epoch());

let custody_columns = gossip_verified_data_columns
.into_iter()
Expand Down
7 changes: 2 additions & 5 deletions beacon_node/lighthouse_network/src/types/globals.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,11 @@ impl<E: EthSpec> NetworkGlobals<E> {
}

/// Compute custody data columns the node is assigned to custody.
pub fn custody_columns(&self, _epoch: Epoch) -> Result<Vec<ColumnIndex>, &'static str> {
pub fn custody_columns(&self, _epoch: Epoch) -> Vec<ColumnIndex> {
let enr = self.local_enr();
let node_id = enr.node_id().raw().into();
let custody_subnet_count = enr.custody_subnet_count::<E>();
Ok(
DataColumnSubnetId::compute_custody_columns::<E>(node_id, custody_subnet_count)
.collect(),
)
DataColumnSubnetId::compute_custody_columns::<E>(node_id, custody_subnet_count).collect()
}

/// TESTING ONLY. Build a dummy NetworkGlobals instance.
Expand Down
2 changes: 1 addition & 1 deletion beacon_node/network/src/sync/backfill_sync/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -952,7 +952,7 @@ impl<T: BeaconChainTypes> BackFillSync<T> {
Err(e) => {
// NOTE: under normal conditions this shouldn't happen but we handle it anyway
warn!(self.log, "Could not send batch request";
"batch_id" => batch_id, "error" => e, &batch);
"batch_id" => batch_id, "error" => ?e, &batch);
// register the failed download and check if the batch can be retried
if let Err(e) = batch.start_downloading_from_peer(peer, 1) {
return self.fail_sync(BackFillError::BatchInvalidState(batch_id, e.0));
Expand Down
12 changes: 6 additions & 6 deletions beacon_node/network/src/sync/block_lookups/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ impl<T: BeaconChainTypes> RequestState<T> for BlockRequestState<T::EthSpec> {
cx: &mut SyncNetworkContext<T>,
) -> Result<LookupRequestResult, LookupRequestError> {
cx.block_lookup_request(id, peer_id, self.requested_block_root)
.map_err(LookupRequestError::SendFailed)
.map_err(LookupRequestError::SendFailedNetwork)
}

fn send_for_processing(
Expand All @@ -106,7 +106,7 @@ impl<T: BeaconChainTypes> RequestState<T> for BlockRequestState<T::EthSpec> {
RpcBlock::new_without_blobs(Some(block_root), value),
seen_timestamp,
)
.map_err(LookupRequestError::SendFailed)
.map_err(LookupRequestError::SendFailedProcessor)
}

fn response_type() -> ResponseType {
Expand Down Expand Up @@ -139,7 +139,7 @@ impl<T: BeaconChainTypes> RequestState<T> for BlobRequestState<T::EthSpec> {
self.block_root,
downloaded_block_expected_blobs,
)
.map_err(LookupRequestError::SendFailed)
.map_err(LookupRequestError::SendFailedNetwork)
}

fn send_for_processing(
Expand All @@ -154,7 +154,7 @@ impl<T: BeaconChainTypes> RequestState<T> for BlobRequestState<T::EthSpec> {
..
} = download_result;
cx.send_blobs_for_processing(id, block_root, value, seen_timestamp)
.map_err(LookupRequestError::SendFailed)
.map_err(LookupRequestError::SendFailedProcessor)
}

fn response_type() -> ResponseType {
Expand Down Expand Up @@ -183,7 +183,7 @@ impl<T: BeaconChainTypes> RequestState<T> for CustodyRequestState<T::EthSpec> {
cx: &mut SyncNetworkContext<T>,
) -> Result<LookupRequestResult, LookupRequestError> {
cx.custody_lookup_request(id, self.block_root, downloaded_block_expected_blobs)
.map_err(LookupRequestError::SendFailed)
.map_err(|e| LookupRequestError::SendFailedNetwork(e))
}

fn send_for_processing(
Expand All @@ -203,7 +203,7 @@ impl<T: BeaconChainTypes> RequestState<T> for CustodyRequestState<T::EthSpec> {
seen_timestamp,
BlockProcessType::SingleCustodyColumn(id),
)
.map_err(LookupRequestError::SendFailed)
.map_err(LookupRequestError::SendFailedProcessor)
}

fn response_type() -> ResponseType {
Expand Down
Loading

0 comments on commit e6f17d3

Please sign in to comment.