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
13 changes: 7 additions & 6 deletions crates/sof-observer/src/framework/host.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@ use std::{
thread,
};

use crate::event::TxCommitmentStatus;
use crate::framework::{
events::{
ClusterTopologyEvent, DatasetEvent, LeaderScheduleEntry, LeaderScheduleEvent,
ObservedRecentBlockhashEvent, RawPacketEvent, ReorgEvent, ShredEvent, SlotStatusEvent,
TransactionBatchEvent, TransactionEvent,
},
plugin::{ObserverPlugin, PluginConfig},
plugin::{ObserverPlugin, PluginConfig, TransactionDispatchMode},
};
use arcshift::ArcShift;
use solana_pubkey::Pubkey;
Expand Down Expand Up @@ -65,7 +66,7 @@ pub struct PluginHostStartupError {

/// Chooses a bounded default worker count for accepted-transaction dispatch.
fn default_transaction_dispatch_workers() -> usize {
std::thread::available_parallelism()
thread::available_parallelism()
.map(usize::from)
.unwrap_or(1)
.clamp(1, DEFAULT_TRANSACTION_DISPATCH_WORKERS_CAP)
Expand Down Expand Up @@ -138,7 +139,7 @@ struct PluginHookSubscriptions {
/// At least one plugin wants transaction callbacks.
transaction: bool,
/// Lowest commitment required by any transaction subscriber.
transaction_min_commitment: crate::event::TxCommitmentStatus,
transaction_min_commitment: TxCommitmentStatus,
/// At least one transaction plugin exposes a compiled prefilter.
transaction_prefilter: bool,
/// At least one plugin wants transaction-log callbacks.
Expand Down Expand Up @@ -187,19 +188,19 @@ impl From<&PluginConfig> for PluginHookSubscriptions {
inline_transaction: config.transaction
&& matches!(
config.transaction_dispatch_mode,
crate::framework::plugin::TransactionDispatchMode::Inline
TransactionDispatchMode::Inline
),
transaction_batch: config.transaction_batch,
inline_transaction_batch: config.transaction_batch
&& matches!(
config.transaction_batch_dispatch_mode,
crate::framework::plugin::TransactionDispatchMode::Inline
TransactionDispatchMode::Inline
),
transaction_view_batch: config.transaction_view_batch,
inline_transaction_view_batch: config.transaction_view_batch
&& matches!(
config.transaction_view_batch_dispatch_mode,
crate::framework::plugin::TransactionDispatchMode::Inline
TransactionDispatchMode::Inline
),
account_touch: config.account_touch,
account_update: config.account_update,
Expand Down
11 changes: 7 additions & 4 deletions crates/sof-observer/src/runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ use std::{
path::PathBuf,
pin::Pin,
sync::Arc,
thread,
time::Instant,
};

Expand All @@ -21,6 +22,8 @@ use crate::framework::{
DerivedStateHost, DerivedStateReplayBackend, DerivedStateReplayDurability, PluginHost,
RuntimeExtensionHost, TransactionEvent,
};
#[cfg(feature = "kernel-bypass")]
use crate::ingest::{RawPacketBatchReceiver, RawPacketBatchSender, create_raw_packet_batch_queue};
use crate::{
app::runtime as app_runtime, event::TxCommitmentStatus, framework, provider_stream, runtime_env,
};
Expand Down Expand Up @@ -2911,7 +2914,7 @@ async fn wait_for_termination_signal() {
#[cfg(unix)]
{
let (shutdown_tx, shutdown_rx) = tokio::sync::oneshot::channel();
std::thread::spawn(move || {
thread::spawn(move || {
let mut signals = match signal_hook::iterator::Signals::new([
signal_hook::consts::signal::SIGTERM,
signal_hook::consts::signal::SIGINT,
Expand Down Expand Up @@ -3051,11 +3054,11 @@ pub async fn run_async_with_hosts_and_derived_state_host_and_setup(
/// External ingress sender type used by `kernel-bypass` integrations.
///
/// Producers publish [`crate::ingest::RawPacketBatch`] values through this queue.
pub type KernelBypassIngressSender = crate::ingest::RawPacketBatchSender;
pub type KernelBypassIngressSender = RawPacketBatchSender;

#[cfg(feature = "kernel-bypass")]
/// External ingress receiver type used by `kernel-bypass` integrations.
pub type KernelBypassIngressReceiver = crate::ingest::RawPacketBatchReceiver;
pub type KernelBypassIngressReceiver = RawPacketBatchReceiver;

#[cfg(feature = "kernel-bypass")]
/// Creates a kernel-bypass ingress queue pair.
Expand All @@ -3065,7 +3068,7 @@ pub type KernelBypassIngressReceiver = crate::ingest::RawPacketBatchReceiver;
#[must_use]
pub fn create_kernel_bypass_ingress_queue()
-> (KernelBypassIngressSender, KernelBypassIngressReceiver) {
crate::ingest::create_raw_packet_batch_queue()
create_raw_packet_batch_queue()
}

#[cfg(feature = "kernel-bypass")]
Expand Down
11 changes: 1 addition & 10 deletions scripts/arch-check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ search_rust_files() {
shift 2

if has_rg; then
rg -n "$@" "${pattern}" >"${output_file}"
rg -n "${pattern}" "$@" >"${output_file}"
return
fi

Expand All @@ -40,15 +40,6 @@ check_forbidden_import() {
local forbidden_target="$2"
local match_file="/tmp/sof-arch-check-${src_slice}-${forbidden_target}.log"

if has_rg; then
if rg -n --glob '!**/tests.rs' "crate::${forbidden_target}\b" "crates/sof-observer/src/${src_slice}" >"${match_file}"; then
echo "ARD boundary violation: '${src_slice}' must not import '${forbidden_target}'"
cat "${match_file}"
violations=1
fi
return
fi

if search_rust_files \
"${match_file}" \
"crate::${forbidden_target}" \
Expand Down
Loading