refactor: remove service_name (#8606)

Which issue # does this PR address?
#8586


  Please list or describe the changes introduced by this PR.
Remove `service_name` from `TaskExecutor`


Co-Authored-By: Abhivansh <31abhivanshj@gmail.com>
This commit is contained in:
Abhivansh
2026-01-02 05:37:40 +05:30
committed by GitHub
parent 6dab3c9a61
commit 9b3d7e3a54
12 changed files with 26 additions and 134 deletions

View File

@@ -109,19 +109,6 @@ pub struct RuntimeContext<E: EthSpec> {
}
impl<E: EthSpec> RuntimeContext<E> {
/// Returns a sub-context of this context.
///
/// The generated service will have the `service_name` in all it's logs.
pub fn service_context(&self, service_name: String) -> Self {
Self {
executor: self.executor.clone_with_name(service_name),
eth_spec_instance: self.eth_spec_instance.clone(),
eth2_config: self.eth2_config.clone(),
eth2_network_config: self.eth2_network_config.clone(),
sse_logging_components: self.sse_logging_components.clone(),
}
}
/// Returns the `eth2_config` for this service.
pub fn eth2_config(&self) -> &Eth2Config {
&self.eth2_config
@@ -349,23 +336,6 @@ impl<E: EthSpec> Environment<E> {
Arc::downgrade(self.runtime()),
self.exit.clone(),
self.signal_tx.clone(),
"core".to_string(),
),
eth_spec_instance: self.eth_spec_instance.clone(),
eth2_config: self.eth2_config.clone(),
eth2_network_config: self.eth2_network_config.clone(),
sse_logging_components: self.sse_logging_components.clone(),
}
}
/// Returns a `Context` where the `service_name` is added to the logger output.
pub fn service_context(&self, service_name: String) -> RuntimeContext<E> {
RuntimeContext {
executor: TaskExecutor::new(
Arc::downgrade(self.runtime()),
self.exit.clone(),
self.signal_tx.clone(),
service_name,
),
eth_spec_instance: self.eth_spec_instance.clone(),
eth2_config: self.eth2_config.clone(),