Skip to content

Commit

Permalink
Merge branch 'unstable' into modularize-validator-store
Browse files Browse the repository at this point in the history
  • Loading branch information
dknopik committed Dec 16, 2024
2 parents b96b046 + 847c801 commit 8d8476f
Show file tree
Hide file tree
Showing 68 changed files with 1,482 additions and 1,047 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ concurrency:
cancel-in-progress: true

env:
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DH_KEY }}
DOCKER_USERNAME: ${{ secrets.DH_ORG }}
# Enable self-hosted runners for the sigp repo only.
SELF_HOSTED_RUNNERS: ${{ github.repository == 'sigp/lighthouse' }}

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ concurrency:
cancel-in-progress: true

env:
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DH_KEY }}
DOCKER_USERNAME: ${{ secrets.DH_ORG }}
REPO_NAME: ${{ github.repository_owner }}/lighthouse
IMAGE_NAME: ${{ github.repository_owner }}/lighthouse
# Enable self-hosted runners for the sigp repo only.
Expand Down
10 changes: 6 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion beacon_node/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "beacon_node"
version = "6.0.0"
version = "6.0.1"
authors = [
"Paul Hauner <paul@paulhauner.com>",
"Age Manning <Age@AgeManning.com",
Expand Down
3 changes: 2 additions & 1 deletion beacon_node/beacon_chain/src/block_verification.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ use std::fs;
use std::io::Write;
use std::sync::Arc;
use store::{Error as DBError, HotStateSummary, KeyValueStore, StoreOp};
use strum::AsRefStr;
use task_executor::JoinHandle;
use types::{
data_column_sidecar::DataColumnSidecarError, BeaconBlockRef, BeaconState, BeaconStateError,
Expand Down Expand Up @@ -137,7 +138,7 @@ const WRITE_BLOCK_PROCESSING_SSZ: bool = cfg!(feature = "write_ssz_files");
///
/// - The block is malformed/invalid (indicated by all results other than `BeaconChainError`.
/// - We encountered an error whilst trying to verify the block (a `BeaconChainError`).
#[derive(Debug)]
#[derive(Debug, AsRefStr)]
pub enum BlockError {
/// The parent block was unknown.
///
Expand Down
4 changes: 3 additions & 1 deletion beacon_node/beacon_chain/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1037,7 +1037,9 @@ where
);

// Check for states to reconstruct (in the background).
if beacon_chain.config.reconstruct_historic_states {
if beacon_chain.config.reconstruct_historic_states
&& beacon_chain.store.get_oldest_block_slot() == 0
{
beacon_chain.store_migrator.process_reconstruction();
}

Expand Down
24 changes: 17 additions & 7 deletions beacon_node/beacon_chain/src/execution_payload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use crate::{
};
use execution_layer::{
BlockProposalContents, BlockProposalContentsType, BuilderParams, NewPayloadRequest,
PayloadAttributes, PayloadStatus,
PayloadAttributes, PayloadParameters, PayloadStatus,
};
use fork_choice::{InvalidationOperation, PayloadVerificationStatus};
use proto_array::{Block as ProtoBlock, ExecutionStatus};
Expand Down Expand Up @@ -375,8 +375,9 @@ pub fn get_execution_payload<T: BeaconChainTypes>(
let timestamp =
compute_timestamp_at_slot(state, state.slot(), spec).map_err(BeaconStateError::from)?;
let random = *state.get_randao_mix(current_epoch)?;
let latest_execution_payload_header_block_hash =
state.latest_execution_payload_header()?.block_hash();
let latest_execution_payload_header = state.latest_execution_payload_header()?;
let latest_execution_payload_header_block_hash = latest_execution_payload_header.block_hash();
let latest_execution_payload_header_gas_limit = latest_execution_payload_header.gas_limit();
let withdrawals = match state {
&BeaconState::Capella(_) | &BeaconState::Deneb(_) | &BeaconState::Electra(_) => {
Some(get_expected_withdrawals(state, spec)?.0.into())
Expand Down Expand Up @@ -406,6 +407,7 @@ pub fn get_execution_payload<T: BeaconChainTypes>(
random,
proposer_index,
latest_execution_payload_header_block_hash,
latest_execution_payload_header_gas_limit,
builder_params,
withdrawals,
parent_beacon_block_root,
Expand Down Expand Up @@ -443,6 +445,7 @@ pub async fn prepare_execution_payload<T>(
random: Hash256,
proposer_index: u64,
latest_execution_payload_header_block_hash: ExecutionBlockHash,
latest_execution_payload_header_gas_limit: u64,
builder_params: BuilderParams,
withdrawals: Option<Vec<Withdrawal>>,
parent_beacon_block_root: Option<Hash256>,
Expand Down Expand Up @@ -526,13 +529,20 @@ where
parent_beacon_block_root,
);

let target_gas_limit = execution_layer.get_proposer_gas_limit(proposer_index).await;
let payload_parameters = PayloadParameters {
parent_hash,
parent_gas_limit: latest_execution_payload_header_gas_limit,
proposer_gas_limit: target_gas_limit,
payload_attributes: &payload_attributes,
forkchoice_update_params: &forkchoice_update_params,
current_fork: fork,
};

let block_contents = execution_layer
.get_payload(
parent_hash,
&payload_attributes,
forkchoice_update_params,
payload_parameters,
builder_params,
fork,
&chain.spec,
builder_boost_factor,
block_production_version,
Expand Down
6 changes: 4 additions & 2 deletions beacon_node/beacon_chain/src/migrate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,10 @@ const MIN_COMPACTION_PERIOD_SECONDS: u64 = 7200;
const COMPACTION_FINALITY_DISTANCE: u64 = 1024;
/// Maximum number of blocks applied in each reconstruction burst.
///
/// This limits the amount of time that the finalization migration is paused for.
const BLOCKS_PER_RECONSTRUCTION: usize = 8192 * 4;
/// This limits the amount of time that the finalization migration is paused for. We set this
/// conservatively because pausing the finalization migration for too long can cause hot state
/// cache misses and excessive disk use.
const BLOCKS_PER_RECONSTRUCTION: usize = 1024;

/// Default number of epochs to wait between finalization migrations.
pub const DEFAULT_EPOCHS_PER_MIGRATION: u64 = 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ pub fn delete_old_schema_freezer_data<T: BeaconChainTypes>(
db.cold_db.do_atomically(cold_ops)?;

// In order to reclaim space, we need to compact the freezer DB as well.
db.cold_db.compact()?;
db.compact_freezer()?;

Ok(())
}
Expand Down
22 changes: 14 additions & 8 deletions beacon_node/beacon_chain/tests/payload_invalidation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -986,10 +986,13 @@ async fn payload_preparation() {
// Provide preparation data to the EL for `proposer`.
el.update_proposer_preparation(
Epoch::new(1),
&[ProposerPreparationData {
validator_index: proposer as u64,
fee_recipient,
}],
[(
&ProposerPreparationData {
validator_index: proposer as u64,
fee_recipient,
},
&None,
)],
)
.await;

Expand Down Expand Up @@ -1119,10 +1122,13 @@ async fn payload_preparation_before_transition_block() {
// Provide preparation data to the EL for `proposer`.
el.update_proposer_preparation(
Epoch::new(0),
&[ProposerPreparationData {
validator_index: proposer as u64,
fee_recipient,
}],
[(
&ProposerPreparationData {
validator_index: proposer as u64,
fee_recipient,
},
&None,
)],
)
.await;

Expand Down
Loading

0 comments on commit 8d8476f

Please sign in to comment.