v0.3.15-pre.007-fix.001

This commit is contained in:
2026-09-13 17:51:44 +02:00
parent 0d9ec5c490
commit 320699e61a
12 changed files with 90 additions and 88 deletions

View File

@@ -99,10 +99,7 @@ impl crate::AppState {
}
/// Revalidates one future Start request and reconstructs its exact Transport/Worker source contract without launching a Worker.
pub(crate) fn validate_route_start(
&self,
request: &crate::RawIngestRouteStartRequestDto,
) -> ksp_core_lib::Result<crate::RawIngestRouteStartValidationDto> {
pub(crate) fn validate_route_start(&self, request: &crate::RawIngestRouteStartRequestDto) -> ksp_core_lib::Result<crate::RawIngestRouteStartValidationDto> {
let generation = self.inventory_generation.lock();
let generation = match generation {
std::result::Result::Ok(value) => *value,

View File

@@ -26,13 +26,7 @@ impl crate::RawIngestRouteId {
/// Returns all V1 route identifiers in stable UI order.
#[must_use]
pub(crate) fn all() -> std::vec::Vec<Self> {
return vec![
Self::YellowstoneHydrated,
Self::StandardLogsHydrated,
Self::StandardBlockDirect,
Self::HeliusTransactionHydrated,
Self::HttpBlockPolling,
];
return vec![Self::YellowstoneHydrated, Self::StandardLogsHydrated, Self::StandardBlockDirect, Self::HeliusTransactionHydrated, Self::HttpBlockPolling];
}
/// Returns the application-owned route family used by safe UI projections.
@@ -263,11 +257,7 @@ impl crate::RawIngestRouteDto {
/// Builds one route that is not composable from the current Config profile.
#[must_use]
pub(crate) fn unavailable(
route_id: crate::RawIngestRouteId,
network: std::option::Option<&str>,
reason: crate::RawIngestRouteUnavailableReason,
) -> Self {
pub(crate) fn unavailable(route_id: crate::RawIngestRouteId, network: std::option::Option<&str>, reason: crate::RawIngestRouteUnavailableReason) -> Self {
return Self {
family: route_id.family(),
label: route_id.label().to_owned(),

View File

@@ -39,11 +39,9 @@ pub(crate) const ERROR_CODE_SPLASH_ORIGIN_INVALID: ksp_core_lib::ErrorCode =
pub(crate) const ERROR_CODE_SPLASH_SETTING_INVALID: ksp_core_lib::ErrorCode =
ksp_core_lib::ErrorCode::new("raw_transaction_ingest_desk", "splash_setting_invalid");
/// Tauri runtime assembly or execution failed.
pub(crate) const ERROR_CODE_TAURI_RUNTIME_FAILED: ksp_core_lib::ErrorCode =
ksp_core_lib::ErrorCode::new("raw_transaction_ingest_desk", "tauri_runtime_failed");
pub(crate) const ERROR_CODE_TAURI_RUNTIME_FAILED: ksp_core_lib::ErrorCode = ksp_core_lib::ErrorCode::new("raw_transaction_ingest_desk", "tauri_runtime_failed");
/// A required Tauri window is missing from the configured application runtime.
pub(crate) const ERROR_CODE_TAURI_WINDOW_MISSING: ksp_core_lib::ErrorCode =
ksp_core_lib::ErrorCode::new("raw_transaction_ingest_desk", "tauri_window_missing");
pub(crate) const ERROR_CODE_TAURI_WINDOW_MISSING: ksp_core_lib::ErrorCode = ksp_core_lib::ErrorCode::new("raw_transaction_ingest_desk", "tauri_window_missing");
/// A Tauri window show/focus/destroy/event operation failed.
pub(crate) const ERROR_CODE_TAURI_WINDOW_OPERATION_FAILED: ksp_core_lib::ErrorCode =
ksp_core_lib::ErrorCode::new("raw_transaction_ingest_desk", "tauri_window_operation_failed");

View File

@@ -45,10 +45,10 @@ pub(crate) use self::constants::COMPOSITE_COMPONENT_ID_LOGGING;
pub(crate) use self::constants::COMPOSITE_COMPONENT_ID_STORE;
/// Composite-local identifier for the standard Transport component.
pub(crate) use self::constants::COMPOSITE_COMPONENT_ID_TRANSPORT;
/// Prefix used by optional same-network Transport capability sources.
pub(crate) use self::constants::COMPOSITE_COMPONENT_ID_TRANSPORT_PREFIX;
/// Composite-local optional Transport source for Helius WebSocket capabilities.
pub(crate) use self::constants::COMPOSITE_COMPONENT_ID_TRANSPORT_HELIUS;
/// Prefix used by optional same-network Transport capability sources.
pub(crate) use self::constants::COMPOSITE_COMPONENT_ID_TRANSPORT_PREFIX;
/// Composite-local optional Transport source for Yellowstone gRPC capabilities.
pub(crate) use self::constants::COMPOSITE_COMPONENT_ID_TRANSPORT_YELLOWSTONE;
/// Structured domain used while bootstrapping Config and Logging.

View File

@@ -1,5 +1,5 @@
// file: crates/ksp-app-raw-transaction-ingest-desk/src/route_inventory.rs
// version: 4
// version: 5
//! Config-only logical route inventory for Raw Transaction Ingest Desk.
@@ -48,10 +48,7 @@ impl RouteCapabilities {
}
/// Rebuilds the complete safe route inventory from validated Config without opening any network, Store or Worker resource.
pub(crate) fn build_route_inventory(
management: &ksp_config_lib::ConfigManagement,
generation: u32,
) -> ksp_core_lib::Result<crate::RawIngestRouteInventoryDto> {
pub(crate) fn build_route_inventory(management: &ksp_config_lib::ConfigManagement, generation: u32) -> ksp_core_lib::Result<crate::RawIngestRouteInventoryDto> {
let environment = ksp_config_lib::ConfigEnvironment::load();
let environment = match environment {
std::result::Result::Ok(value) => value,
@@ -61,7 +58,7 @@ pub(crate) fn build_route_inventory(
}
/// Rebuilds the complete safe route inventory from one already captured Config environment snapshot.
pub(crate) pub(crate) fn build_route_inventory_with_environment(
pub(crate) fn build_route_inventory_with_environment(
management: &ksp_config_lib::ConfigManagement,
environment: &ksp_config_lib::ConfigEnvironment,
generation: u32,
@@ -73,12 +70,7 @@ pub(crate) pub(crate) fn build_route_inventory_with_environment(
};
let mut profiles = std::vec::Vec::with_capacity(catalog.profile_ids.len());
for profile_id in &catalog.profile_ids {
profiles.push(build_profile_inventory(
management,
environment,
profile_id.as_str(),
profile_id == &catalog.default_profile,
));
profiles.push(build_profile_inventory(management, environment, profile_id.as_str(), profile_id == &catalog.default_profile));
}
ksp_logging_lib::debug!(
target: crate::TRACING_TARGET,
@@ -164,11 +156,8 @@ fn build_profile_inventory(
},
};
let network = store.settings().network().as_str().to_owned();
let base_transport_profile = crate::required_composite_component_profile(
&composite,
crate::COMPOSITE_COMPONENT_ID_TRANSPORT,
ksp_config_lib::FILE_ID_STD_TRANSPORT,
);
let base_transport_profile =
crate::required_composite_component_profile(&composite, crate::COMPOSITE_COMPONENT_ID_TRANSPORT, ksp_config_lib::FILE_ID_STD_TRANSPORT);
let base_transport_profile = match base_transport_profile {
std::result::Result::Ok(value) => value,
std::result::Result::Err(_) => {
@@ -184,12 +173,7 @@ fn build_profile_inventory(
let base_transport = match base_transport {
std::result::Result::Ok(value) => value,
std::result::Result::Err(error) => {
return unavailable_profile(
profile_id,
is_default,
std::option::Option::Some(network.as_str()),
resolution_error_reason(&error),
);
return unavailable_profile(profile_id, is_default, std::option::Option::Some(network.as_str()), resolution_error_reason(&error));
},
};
if !transport_matches_network(&base_transport, network.as_str()) {

View File

@@ -60,11 +60,8 @@ pub(crate) fn validate_route_start(
"Raw Transaction Ingest Desk Start-time Store network no longer matches the selected route",
));
}
let transport_profile = crate::required_composite_component_profile(
&composite,
crate::COMPOSITE_COMPONENT_ID_TRANSPORT,
ksp_config_lib::FILE_ID_STD_TRANSPORT,
);
let transport_profile =
crate::required_composite_component_profile(&composite, crate::COMPOSITE_COMPONENT_ID_TRANSPORT, ksp_config_lib::FILE_ID_STD_TRANSPORT);
let transport_profile = match transport_profile {
std::result::Result::Ok(value) => value,
std::result::Result::Err(error) => return route_start_error("Cannot resolve Start-time base Transport profile", error),
@@ -115,12 +112,8 @@ fn prepare_standard_logs(
network: &str,
commitment: ksp_onchain_transport_lib::SolanaCommitment,
) -> ksp_core_lib::Result<()> {
let endpoint = single_ws_endpoint(
transport,
network,
ksp_onchain_transport_lib::WsProtocolKind::SolanaStandard,
ksp_onchain_transport_lib::WsSubscriptionKind::Logs,
);
let endpoint =
single_ws_endpoint(transport, network, ksp_onchain_transport_lib::WsProtocolKind::SolanaStandard, ksp_onchain_transport_lib::WsSubscriptionKind::Logs);
let endpoint = match endpoint {
std::result::Result::Ok(value) => value,
std::result::Result::Err(error) => return std::result::Result::Err(error),
@@ -155,12 +148,8 @@ fn prepare_standard_block(
network: &str,
commitment: ksp_onchain_transport_lib::SolanaCommitment,
) -> ksp_core_lib::Result<()> {
let endpoint = single_ws_endpoint(
transport,
network,
ksp_onchain_transport_lib::WsProtocolKind::SolanaStandard,
ksp_onchain_transport_lib::WsSubscriptionKind::Block,
);
let endpoint =
single_ws_endpoint(transport, network, ksp_onchain_transport_lib::WsProtocolKind::SolanaStandard, ksp_onchain_transport_lib::WsSubscriptionKind::Block);
let endpoint = match endpoint {
std::result::Result::Ok(value) => value,
std::result::Result::Err(error) => return std::result::Result::Err(error),
@@ -416,9 +405,7 @@ fn single_http_role(
let matching = roles
.into_iter()
.filter(|role_name| {
return request_kinds
.iter()
.all(|request_kind| return http_role_supports_request_kind(settings, network, role_name.as_str(), request_kind));
return request_kinds.iter().all(|request_kind| return http_role_supports_request_kind(settings, network, role_name.as_str(), request_kind));
})
.collect::<std::vec::Vec<_>>();
if matching.len() != 1 {
@@ -427,12 +414,7 @@ fn single_http_role(
return std::result::Result::Ok(ksp_onchain_transport_lib::HttpRoleName::new(matching[0].clone()));
}
fn http_role_supports_request_kind(
settings: &ksp_onchain_transport_lib::HttpTransportSettings,
network: &str,
role_name: &str,
request_kind: &str,
) -> bool {
fn http_role_supports_request_kind(settings: &ksp_onchain_transport_lib::HttpTransportSettings, network: &str, role_name: &str, request_kind: &str) -> bool {
for endpoint in settings.endpoints() {
if !endpoint.enabled() || endpoint.cluster().as_str() != network {
continue;

View File

@@ -149,8 +149,6 @@ async fn validate_route_start(
let result = state.validate_route_start(&request);
return match result {
std::result::Result::Ok(value) => std::result::Result::Ok(value),
std::result::Result::Err(error) => {
std::result::Result::Err(project_command_error("validate_route_start", crate::TRACING_DOMAIN_ROUTE_START, &error))
},
std::result::Result::Err(error) => std::result::Result::Err(project_command_error("validate_route_start", crate::TRACING_DOMAIN_ROUTE_START, &error)),
};
}

View File

@@ -1,5 +1,5 @@
// file: crates/ksp-app-raw-transaction-ingest-desk/tests/desktop_security.rs
// version: 4
// version: 5
//! Desktop security canaries for the Raw Transaction Ingest Desk scaffold.
@@ -107,6 +107,6 @@ fn pre_007_start_request_and_acknowledgement_are_logical_only_and_resource_free(
assert!(route_start.contains("ERROR_CODE_ROUTE_START_STALE_INVENTORY"));
assert!(route_start.contains("build_route_inventory_with_environment"));
assert!(route_start.contains("resolve_store_config_profile"));
assert!(!route_start.contains("with_context("endpoint"));
assert!(!route_start.contains("with_context("provider"));
assert!(!route_start.contains("with_context(\"endpoint\""));
assert!(!route_start.contains("with_context(\"provider\""));
}

View File

@@ -27,12 +27,8 @@ fn pre_006_route_requirement_projection_is_fail_closed_and_ordered() {
#[test]
fn pre_006_unavailable_profile_projects_all_five_routes_without_physical_material() {
let profile = super::unavailable_profile(
"mainnet",
false,
std::option::Option::Some("mainnet"),
crate::RawIngestRouteUnavailableReason::MissingRequiredSecret,
);
let profile =
super::unavailable_profile("mainnet", false, std::option::Option::Some("mainnet"), crate::RawIngestRouteUnavailableReason::MissingRequiredSecret);
assert_eq!(profile.routes.len(), 5);
assert_eq!(profile.network.as_deref(), std::option::Option::Some("mainnet"));
for route in profile.routes {
@@ -63,7 +59,10 @@ fn pre_006_fix_003_network_profiles_aggregate_same_network_capabilities_and_omit
};
assert_eq!(inventory.generation, 7);
assert_eq!(inventory.default_profile, "devnet");
assert_eq!(inventory.profiles.iter().map(|profile| return profile.profile_id.as_str()).collect::<std::vec::Vec<_>>(), vec!["devnet", "mainnet", "testnet"]);
assert_eq!(
inventory.profiles.iter().map(|profile| return profile.profile_id.as_str()).collect::<std::vec::Vec<_>>(),
vec!["devnet", "mainnet", "testnet"]
);
let devnet = profile(&inventory, "devnet");
assert!(devnet.is_some());
if let std::option::Option::Some(devnet) = devnet {

View File

@@ -1,7 +1,6 @@
// file: crates/ksp-app-raw-transaction-ingest-desk/unit_tests/route_start.rs
// version: 1
#[test]
fn pre_007_stale_generation_is_rejected_before_config_or_transport_reconstruction() {
let management = crate::config_management(&[]);
@@ -46,7 +45,8 @@ fn pre_007_public_standard_profiles_reconstruct_block_and_http_sources_without_n
std::result::Result::Err(_) => return,
};
for profile in inventory.profiles {
for route_id in [crate::RawIngestRouteId::StandardLogsHydrated, crate::RawIngestRouteId::StandardBlockDirect, crate::RawIngestRouteId::HttpBlockPolling] {
for route_id in [crate::RawIngestRouteId::StandardLogsHydrated, crate::RawIngestRouteId::StandardBlockDirect, crate::RawIngestRouteId::HttpBlockPolling]
{
let route = profile.routes.iter().find(|route| return route.route_id == route_id);
assert!(route.is_some(), "missing base route for {}", profile.profile_id);
if let std::option::Option::Some(route) = route {