Skip to content
Open
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
9 changes: 7 additions & 2 deletions beacon_node/beacon_chain/src/test_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -480,8 +480,13 @@ where
suggested_fee_recipient: Some(Address::repeat_byte(42)),
..Default::default()
};
let execution_layer =
ExecutionLayer::from_config(config, self.runtime.task_executor.clone()).unwrap();
let execution_layer = ExecutionLayer::from_config(
config,
self.runtime.task_executor.clone(),
&test_spec::<E>(),
0,
)
.unwrap();

self.execution_layer = Some(execution_layer);
self
Expand Down
26 changes: 16 additions & 10 deletions beacon_node/client/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,15 +178,6 @@ where
None
};

let execution_layer = if let Some(config) = config.execution_layer.clone() {
let context = runtime_context.clone();
let execution_layer = ExecutionLayer::from_config(config, context.executor.clone())
.map_err(|e| format!("unable to start execution layer endpoints: {:?}", e))?;
Some(execution_layer)
} else {
None
};

let kzg_err_msg = |e| format!("Failed to load trusted setup: {:?}", e);
let kzg = if spec.is_peer_das_scheduled() {
Kzg::new_from_trusted_setup(&config.trusted_setup).map_err(kzg_err_msg)?
Expand All @@ -209,7 +200,6 @@ where
.chain_config(chain_config)
.beacon_graffiti(beacon_graffiti)
.event_handler(event_handler)
.execution_layer(execution_layer)
.node_custody_type(config.chain.node_custody_type)
.ordered_custody_column_indices(ordered_custody_column_indices)
.validator_monitor_config(config.validator_monitor.clone())
Expand Down Expand Up @@ -462,6 +452,22 @@ where
ClientGenesis::FromStore => builder.resume_from_db()?,
};

let beacon_chain_builder = if let Some(execution_config) = config.execution_layer.clone() {
let genesis_time = beacon_chain_builder
.genesis_time
.ok_or("execution layer requires a genesis time")?;
let execution_layer = ExecutionLayer::from_config(
execution_config,
context.executor.clone(),
&spec,
genesis_time,
)
.map_err(|e| format!("unable to start execution layer endpoints: {:?}", e))?;
beacon_chain_builder.execution_layer(Some(execution_layer))
} else {
beacon_chain_builder
};
Comment on lines +455 to +469

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move after the ExecutionLayer construction a bit in order to get genesis_time


self.beacon_chain_builder = Some(beacon_chain_builder);
Ok(self)
}
Expand Down
Loading
Loading