Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion beacon_node/beacon_chain/src/beacon_chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ use crate::block_verification_types::{
};
pub use crate::canonical_head::CanonicalHead;
use crate::chain_config::ChainConfig;
use crate::custody_context::CustodyContextSsz;
use crate::data_availability_checker::{
Availability, AvailabilityCheckError, AvailableBlock, AvailableBlockData,
DataAvailabilityChecker, DataColumnReconstructionResult,
Expand Down Expand Up @@ -64,7 +65,6 @@ use crate::shuffling_cache::{BlockShufflingIds, ShufflingCache};
use crate::sync_committee_verification::{
Error as SyncCommitteeError, VerifiedSyncCommitteeMessage, VerifiedSyncContribution,
};
use crate::validator_custody::CustodyContextSsz;
use crate::validator_monitor::{
HISTORIC_EPOCHS as VALIDATOR_MONITOR_HISTORIC_EPOCHS, ValidatorMonitor, get_slot_delay_ms,
timestamp_now,
Expand Down
16 changes: 9 additions & 7 deletions beacon_node/beacon_chain/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use crate::beacon_chain::{
BEACON_CHAIN_DB_KEY, CanonicalHead, LightClientProducerEvent, OP_POOL_DB_KEY,
};
use crate::beacon_proposer_cache::BeaconProposerCache;
use crate::custody_context::NodeCustodyType;
use crate::data_availability_checker::DataAvailabilityChecker;
use crate::fork_choice_signal::ForkChoiceSignalTx;
use crate::fork_revert::{reset_fork_choice_to_finalization, revert_to_fork_boundary};
Expand Down Expand Up @@ -100,7 +101,7 @@ pub struct BeaconChainBuilder<T: BeaconChainTypes> {
kzg: Arc<Kzg>,
task_executor: Option<TaskExecutor>,
validator_monitor_config: Option<ValidatorMonitorConfig>,
import_all_data_columns: bool,
node_custody_type: NodeCustodyType,
rng: Option<Box<dyn RngCore + Send>>,
}

Expand Down Expand Up @@ -139,7 +140,7 @@ where
kzg,
task_executor: None,
validator_monitor_config: None,
import_all_data_columns: false,
node_custody_type: NodeCustodyType::Fullnode,
rng: None,
}
}
Expand Down Expand Up @@ -640,9 +641,9 @@ where
self
}

/// Sets whether to require and import all data columns when importing block.
pub fn import_all_data_columns(mut self, import_all_data_columns: bool) -> Self {
self.import_all_data_columns = import_all_data_columns;
/// Sets the node custody type for data column import.
pub fn node_custody_type(mut self, node_custody_type: NodeCustodyType) -> Self {
self.node_custody_type = node_custody_type;
self
}

Expand Down Expand Up @@ -935,10 +936,11 @@ where
{
Arc::new(CustodyContext::new_from_persisted_custody_context(
custody,
self.import_all_data_columns,
self.node_custody_type,
&self.spec,
))
} else {
Arc::new(CustodyContext::new(self.import_all_data_columns))
Arc::new(CustodyContext::new(self.node_custody_type, &self.spec))
};
debug!(?custody_context, "Loading persisted custody context");

Expand Down
4 changes: 4 additions & 0 deletions beacon_node/beacon_chain/src/chain_config.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use crate::custody_context::NodeCustodyType;
pub use proto_array::{DisallowedReOrgOffsets, ReOrgThreshold};
use serde::{Deserialize, Serialize};
use std::str::FromStr;
Expand Down Expand Up @@ -118,6 +119,8 @@ pub struct ChainConfig {
pub invalid_block_roots: HashSet<Hash256>,
/// Disable the getBlobs optimisation to fetch blobs from the EL mempool.
pub disable_get_blobs: bool,
/// The node's custody type, determining how many data columns to custody and sample.
pub node_custody_type: NodeCustodyType,
}

impl Default for ChainConfig {
Expand Down Expand Up @@ -158,6 +161,7 @@ impl Default for ChainConfig {
data_column_publishing_delay: None,
invalid_block_roots: HashSet::new(),
disable_get_blobs: false,
node_custody_type: NodeCustodyType::Fullnode,
}
}
}
Expand Down
Loading
Loading