Skip to content

Commit 631b673

Browse files
committed
Small fixes
1 parent 8f0b25e commit 631b673

File tree

6 files changed

+10
-18
lines changed

6 files changed

+10
-18
lines changed

beacon_node/beacon_processor/src/lib.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,6 @@ pub const NOTHING_TO_DO: &str = "nothing_to_do";
120120

121121
#[derive(Clone, PartialEq, Debug, Serialize, Deserialize)]
122122
pub struct BeaconProcessorConfig {
123-
pub max_workers: usize,
124123
pub max_io_bound_workers: usize,
125124
pub max_cpu_bound_workers: usize,
126125
pub max_work_event_queue_len: usize,
@@ -133,7 +132,6 @@ pub struct BeaconProcessorConfig {
133132
impl Default for BeaconProcessorConfig {
134133
fn default() -> Self {
135134
Self {
136-
max_workers: cmp::max(1, num_cpus::get()),
137135
max_io_bound_workers: MAX_IO_BOUND_WORKERS,
138136
max_cpu_bound_workers: cmp::max(1, num_cpus::get()),
139137
max_work_event_queue_len: DEFAULT_MAX_WORK_EVENT_QUEUE_LEN,
@@ -431,7 +429,7 @@ impl<E: EthSpec> BeaconProcessor<E> {
431429
/// - Performed immediately, if a worker is available.
432430
/// - Queued for later processing, if no worker is currently available.
433431
///
434-
/// Only `self.config.max_workers` will ever be spawned at one time. Each worker is a `tokio` task
432+
/// Only `self.config.max_cpu_bound_workers + self.config.max_io_bound_workers` will ever be spawned at one time. Each worker is a `tokio` task
435433
/// started with `spawn_blocking`.
436434
///
437435
/// The optional `work_journal_tx` allows for an outside process to receive a log of all work
@@ -1095,7 +1093,7 @@ impl<E: EthSpec> BeaconProcessor<E> {
10951093
// following head.
10961094
//
10971095
// Check attester slashings before proposer slashings since they have the
1098-
// potential to slash multiple validators at once.
1096+
// potential to slash multiple validators at ongice.
10991097
.or_else(|| {
11001098
work_queues
11011099
.gossip_attester_slashing_queue

beacon_node/beacon_processor/src/work.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,6 @@ impl WorkCategory {
166166
match work_type {
167167
// IO bound tasks
168168
WorkType::GossipAttestationToConvert
169-
| WorkType::UnknownBlockAggregate
170169
| WorkType::UnknownLightClientOptimisticUpdate
171170
| WorkType::GossipVoluntaryExit
172171
| WorkType::GossipProposerSlashing
@@ -190,14 +189,15 @@ impl WorkCategory {
190189
| WorkType::LightClientUpdatesByRangeRequest
191190
| WorkType::ApiRequestP0
192191
| WorkType::ApiRequestP1
193-
| WorkType::Reprocess
194-
| WorkType::GossipAggregateBatch => Self::IoBound,
192+
| WorkType::Reprocess => Self::IoBound,
195193
// CPU bound tasks
196194
WorkType::GossipBlock
197195
| WorkType::UnknownBlockAttestation
196+
| WorkType::UnknownBlockAggregate
198197
| WorkType::GossipAttestation
199198
| WorkType::GossipAttestationBatch
200199
| WorkType::GossipAggregate
200+
| WorkType::GossipAggregateBatch
201201
| WorkType::GossipBlobSidecar
202202
| WorkType::GossipDataColumnSidecar
203203
| WorkType::DelayedImportBlock

beacon_node/http_api/src/test_utils.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -247,11 +247,6 @@ pub async fn create_api_server_with_config<T: BeaconChainTypes>(
247247
*network_globals.sync_state.write() = SyncState::Synced;
248248

249249
let beacon_processor_config = BeaconProcessorConfig {
250-
// The number of workers must be greater than one. Tests which use the
251-
// builder workflow sometimes require an internal HTTP request in order
252-
// to fulfill an already in-flight HTTP request, therefore having only
253-
// one worker will result in a deadlock.
254-
max_workers: 2,
255250
..BeaconProcessorConfig::default()
256251
};
257252
let BeaconProcessorChannels {

beacon_node/src/config.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -830,10 +830,10 @@ pub fn get_config<E: EthSpec>(
830830

831831
if let Some(max_workers) = clap_utils::parse_optional(cli_args, "beacon-processor-max-workers")?
832832
{
833-
client_config.beacon_processor.max_workers = max_workers;
833+
client_config.beacon_processor.max_cpu_bound_workers = max_workers;
834834
}
835835

836-
if client_config.beacon_processor.max_workers == 0 {
836+
if client_config.beacon_processor.max_cpu_bound_workers == 0 {
837837
return Err("--beacon-processor-max-workers must be a non-zero value".to_string());
838838
}
839839

lighthouse/tests/beacon_node.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2684,9 +2684,8 @@ fn beacon_processor() {
26842684
assert_eq!(
26852685
config.beacon_processor,
26862686
BeaconProcessorConfig {
2687-
max_workers: 1,
2688-
max_cpu_bound_workers: 0,
2689-
max_io_bound_workers: 0,
2687+
max_io_bound_workers: 100,
2688+
max_cpu_bound_workers: 8,
26902689
max_work_event_queue_len: 2,
26912690
max_scheduled_work_queue_len: 3,
26922691
max_gossip_attestation_batch_size: 4,

testing/node_test_rig/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ pub fn testing_client_config() -> ClientConfig {
120120
// Specify a constant count of beacon processor workers. Having this number
121121
// too low can cause annoying HTTP timeouts, especially on Github runners
122122
// with 2 logical CPUs.
123-
client_config.beacon_processor.max_workers = 4;
123+
client_config.beacon_processor.max_cpu_bound_workers = 4;
124124

125125
client_config
126126
}

0 commit comments

Comments
 (0)