Skip to content

Commit 22f7f73

Browse files
committed
Merge remote-tracking branch 'origin/unstable' into tree-states-hot-rebase
2 parents 9e77f82 + 8c6abc0 commit 22f7f73

File tree

86 files changed

+1263
-343
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+1263
-343
lines changed

.github/workflows/local-testnet.yml

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ jobs:
6767
working-directory: scripts/local_testnet
6868

6969
- name: Upload logs artifact
70+
if: always()
7071
uses: actions/upload-artifact@v4
7172
with:
7273
name: logs-local-testnet
@@ -125,6 +126,7 @@ jobs:
125126
working-directory: scripts/tests
126127

127128
- name: Upload logs artifact
129+
if: always()
128130
uses: actions/upload-artifact@v4
129131
with:
130132
name: logs-doppelganger-protection-success
@@ -160,13 +162,56 @@ jobs:
160162
working-directory: scripts/tests
161163

162164
- name: Upload logs artifact
165+
if: always()
163166
uses: actions/upload-artifact@v4
164167
with:
165168
name: logs-doppelganger-protection-failure
166169
path: |
167170
scripts/local_testnet/logs
168171
retention-days: 3
169172

173+
# Tests checkpoint syncing to a live network (current fork) and a running devnet (usually next scheduled fork)
174+
checkpoint-sync-test:
175+
name: checkpoint-sync-test-${{ matrix.network }}
176+
runs-on: ubuntu-latest
177+
needs: dockerfile-ubuntu
178+
if: contains(github.event.pull_request.labels.*.name, 'syncing')
179+
continue-on-error: true
180+
strategy:
181+
matrix:
182+
network: [sepolia, devnet]
183+
steps:
184+
- uses: actions/checkout@v4
185+
186+
- name: Install Kurtosis
187+
run: |
188+
echo "deb [trusted=yes] https://apt.fury.io/kurtosis-tech/ /" | sudo tee /etc/apt/sources.list.d/kurtosis.list
189+
sudo apt update
190+
sudo apt install -y kurtosis-cli
191+
kurtosis analytics disable
192+
193+
- name: Download Docker image artifact
194+
uses: actions/download-artifact@v4
195+
with:
196+
name: lighthouse-docker
197+
path: .
198+
199+
- name: Load Docker image
200+
run: docker load -i lighthouse-docker.tar
201+
202+
- name: Run the checkpoint sync test script
203+
run: |
204+
./checkpoint-sync.sh "sync-${{ matrix.network }}" "checkpoint-sync-config-${{ matrix.network }}.yaml"
205+
working-directory: scripts/tests
206+
207+
- name: Upload logs artifact
208+
if: always()
209+
uses: actions/upload-artifact@v4
210+
with:
211+
name: logs-checkpoint-sync-${{ matrix.network }}
212+
path: |
213+
scripts/local_testnet/logs
214+
retention-days: 3
170215

171216
# This job succeeds ONLY IF all others succeed. It is used by the merge queue to determine whether
172217
# a PR is safe to merge. New jobs should be added here.
@@ -182,4 +227,6 @@ jobs:
182227
steps:
183228
- uses: actions/checkout@v4
184229
- name: Check that success job is dependent on all others
185-
run: ./scripts/ci/check-success-job.sh ./.github/workflows/local-testnet.yml local-testnet-success
230+
run: |
231+
exclude_jobs='checkpoint-sync-test'
232+
./scripts/ci/check-success-job.sh ./.github/workflows/local-testnet.yml local-testnet-success "$exclude_jobs"

Cargo.lock

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Makefile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,9 @@ run-state-transition-tests:
218218
# Downloads and runs the EF test vectors.
219219
test-ef: make-ef-tests run-ef-tests
220220

221+
# Downloads and runs the nightly EF test vectors.
222+
test-ef-nightly: make-ef-tests-nightly run-ef-tests
223+
221224
# Downloads and runs the EF test vectors with nextest.
222225
nextest-ef: make-ef-tests nextest-run-ef-tests
223226

@@ -278,6 +281,10 @@ lint-full:
278281
make-ef-tests:
279282
make -C $(EF_TESTS)
280283

284+
# Download/extract the nightly EF test vectors.
285+
make-ef-tests-nightly:
286+
CONSENSUS_SPECS_TEST_VERSION=nightly make -C $(EF_TESTS)
287+
281288
# Verifies that crates compile with fuzzing features enabled
282289
arbitrary-fuzz:
283290
cargo check -p state_processing --features arbitrary-fuzz,$(TEST_FEATURES)

account_manager/src/validator/import.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ pub fn cli_app() -> Command {
3232
.about(
3333
"Imports one or more EIP-2335 passwords into a Lighthouse VC directory, \
3434
requesting passwords interactively. The directory flag provides a convenient \
35-
method for importing a directory of keys generated by the eth2-deposit-cli \
35+
method for importing a directory of keys generated by the ethstaker-deposit-cli \
3636
Python utility.",
3737
)
3838
.arg(

beacon_node/beacon_chain/src/beacon_proposer_cache.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ pub fn compute_proposer_duties_from_head<T: BeaconChainTypes>(
181181
ensure_state_is_in_epoch(&mut state, head_state_root, request_epoch, &chain.spec)?;
182182

183183
let indices = state
184-
.get_beacon_proposer_indices(&chain.spec)
184+
.get_beacon_proposer_indices(request_epoch, &chain.spec)
185185
.map_err(BeaconChainError::from)?;
186186

187187
let dependent_root = state

beacon_node/beacon_chain/src/blob_verification.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,8 @@ pub fn validate_blob_sidecar_for_gossip<T: BeaconChainTypes, O: ObservationStrat
523523
&chain.spec,
524524
)?;
525525

526-
let proposers = state.get_beacon_proposer_indices(&chain.spec)?;
526+
let epoch = state.current_epoch();
527+
let proposers = state.get_beacon_proposer_indices(epoch, &chain.spec)?;
527528
let proposer_index = *proposers
528529
.get(blob_slot.as_usize() % T::EthSpec::slots_per_epoch() as usize)
529530
.ok_or_else(|| BeaconChainError::NoProposerForSlot(blob_slot))?;

beacon_node/beacon_chain/src/block_verification.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -962,7 +962,8 @@ impl<T: BeaconChainTypes> GossipVerifiedBlock<T> {
962962
&chain.spec,
963963
)?;
964964

965-
let proposers = state.get_beacon_proposer_indices(&chain.spec)?;
965+
let epoch = state.current_epoch();
966+
let proposers = state.get_beacon_proposer_indices(epoch, &chain.spec)?;
966967
let proposer_index = *proposers
967968
.get(block.slot().as_usize() % T::EthSpec::slots_per_epoch() as usize)
968969
.ok_or_else(|| BeaconChainError::NoProposerForSlot(block.slot()))?;

beacon_node/beacon_chain/src/builder.rs

Lines changed: 30 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -494,24 +494,36 @@ where
494494

495495
// Verify that blobs (if provided) match the block.
496496
if let Some(blobs) = &weak_subj_blobs {
497-
let commitments = weak_subj_block
498-
.message()
499-
.body()
500-
.blob_kzg_commitments()
501-
.map_err(|e| format!("Blobs provided but block does not reference them: {e:?}"))?;
502-
if blobs.len() != commitments.len() {
503-
return Err(format!(
504-
"Wrong number of blobs, expected: {}, got: {}",
505-
commitments.len(),
506-
blobs.len()
507-
));
508-
}
509-
if commitments
510-
.iter()
511-
.zip(blobs.iter())
512-
.any(|(commitment, blob)| *commitment != blob.kzg_commitment)
513-
{
514-
return Err("Checkpoint blob does not match block commitment".into());
497+
let fulu_enabled = weak_subj_block.fork_name_unchecked().fulu_enabled();
498+
if fulu_enabled && blobs.is_empty() {
499+
// Blobs expected for this block, but the checkpoint server is not able to serve them.
500+
// This is expected from Fulu, as only supernodes are able to serve blobs.
501+
// We can consider using backfill to retrieve the data columns from the p2p network,
502+
// but we can ignore this fow now until we have validator custody backfill
503+
// implemented as we'll likely be able to reuse the logic.
504+
// https://github.com/sigp/lighthouse/issues/6837
505+
} else {
506+
let commitments = weak_subj_block
507+
.message()
508+
.body()
509+
.blob_kzg_commitments()
510+
.map_err(|e| {
511+
format!("Blobs provided but block does not reference them: {e:?}")
512+
})?;
513+
if blobs.len() != commitments.len() {
514+
return Err(format!(
515+
"Wrong number of blobs, expected: {}, got: {}",
516+
commitments.len(),
517+
blobs.len()
518+
));
519+
}
520+
if commitments
521+
.iter()
522+
.zip(blobs.iter())
523+
.any(|(commitment, blob)| *commitment != blob.kzg_commitment)
524+
{
525+
return Err("Checkpoint blob does not match block commitment".into());
526+
}
515527
}
516528
}
517529

beacon_node/beacon_chain/src/data_column_verification.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,8 @@ fn verify_proposer_and_signature<T: BeaconChainTypes>(
669669
&chain.spec,
670670
)?;
671671

672-
let proposers = state.get_beacon_proposer_indices(&chain.spec)?;
672+
let epoch = state.current_epoch();
673+
let proposers = state.get_beacon_proposer_indices(epoch, &chain.spec)?;
673674
// Prime the proposer shuffling cache with the newly-learned value.
674675
Ok::<_, GossipDataColumnError>(EpochBlockProposers {
675676
epoch: column_epoch,

beacon_node/beacon_chain/src/kzg_utils.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,9 +187,9 @@ pub fn blobs_to_data_column_sidecars<E: EthSpec>(
187187
.collect::<Vec<_>>();
188188

189189
// NOTE: assumes blob sidecars are ordered by index
190-
let blob_cells_and_proofs_vec = blobs
190+
let zipped: Vec<_> = blobs.iter().zip(proof_chunks).collect();
191+
let blob_cells_and_proofs_vec = zipped
191192
.into_par_iter()
192-
.zip(proof_chunks.into_par_iter())
193193
.map(|(blob, proofs)| {
194194
let blob = blob
195195
.as_ref()

0 commit comments

Comments
 (0)