v0.3.15-pre.009-fix.002

This commit is contained in:
2026-09-14 15:19:55 +02:00
parent d7c2931c10
commit 8ae4d0effd
9 changed files with 277 additions and 10 deletions

View File

@@ -0,0 +1,5 @@
// file: crates/ksp-worker-raw-transaction-ingest-lib/src/constants.rs
// version: 1
/// Explicit tracing target owned by the RAW transaction ingest Worker crate.
pub(crate) const TRACING_TARGET: &str = "ksp-worker-raw-transaction-ingest-lib";

View File

@@ -1,5 +1,5 @@
// file: crates/ksp-worker-raw-transaction-ingest-lib/src/lib.rs
// version: 33
// version: 34
#![warn(missing_docs)]
#![deny(unreachable_pub)]
@@ -22,6 +22,7 @@
//! absent only while currently active siblings preserve the configured TargetCoverage. Transport source respawn remains forbidden.
mod admission;
mod constants;
mod continuity;
mod error;
mod identity;
@@ -122,6 +123,8 @@ pub use self::snapshot::RawTransactionIngestSourceState;
pub(crate) use self::admission::RawTransactionAdmission;
/// Crate-private source-neutral ingress sent through the bounded central admission queue.
pub(crate) use self::admission::RawTransactionIngress;
/// Explicit tracing target owned by this behavioral crate.
pub(crate) use self::constants::TRACING_TARGET;
/// Maximum number of slots admitted by one private continuity HTTP discovery window.
pub(crate) use self::continuity::MAX_RAW_TRANSACTION_INGEST_CONTINUITY_DISCOVERY_WINDOW_SLOTS;
/// Private source continuity-capability descriptor prepared without network or Store I/O.

View File

@@ -1,5 +1,5 @@
// file: crates/ksp-worker-raw-transaction-ingest-lib/src/runtime_resources.rs
// version: 46
// version: 47
use sha2::Digest; // rust-rules: trait-import
@@ -465,14 +465,16 @@ impl RawTransactionIngestLiveSource {
return std::result::Result::Err(error);
}
if let std::result::Result::Err(error) = &result {
let condition = source_error_context_value(error, "condition").unwrap_or("none");
let transport_domain = source_error_context_value(error, "transport_domain").unwrap_or("none");
let transport_code = source_error_context_value(error, "transport_code").unwrap_or("none");
ksp_logging_lib::warn!(
target: "ksp-worker-raw-transaction-ingest-lib",
target: crate::TRACING_TARGET,
domain = "raw_transaction_ingest.source",
source_kind = source_kind,
error_domain = error.code().domain(),
error_code = error.code().code(),
condition = condition,
transport_domain = transport_domain,
transport_code = transport_code,
"RAW transaction ingest live source reached terminal failure"

View File

@@ -1,5 +1,5 @@
// file: crates/ksp-worker-raw-transaction-ingest-lib/unit_tests/runtime_resources.rs
// version: 37
// version: 38
fn grpc_endpoint(cluster: &str) -> std::option::Option<ksp_onchain_transport_lib::YellowstoneGrpcEndpointSettings> {
return grpc_endpoint_with_identity(cluster, "yellowstone-fixture", "fixture-provider");
@@ -4636,3 +4636,12 @@ fn v0_3_15_pre_009_fix_001_source_error_context_projection_is_key_bounded() {
assert_eq!(super::source_error_context_value(&error, "unknown"), std::option::Option::None);
return;
}
#[test]
fn v0_3_15_pre_009_fix_002_source_error_context_projects_safe_internal_condition() {
let error = crate::runtime_error("source.fixture_condition");
assert_eq!(super::source_error_context_value(&error, "condition"), std::option::Option::Some("source.fixture_condition"));
assert_eq!(super::source_error_context_value(&error, "transport_domain"), std::option::Option::None);
assert_eq!(super::source_error_context_value(&error, "transport_code"), std::option::Option::None);
return;
}

View File

@@ -1,5 +1,5 @@
// file: crates/ksp-worker-raw-transaction-ingest-lib/unit_tests/settings.rs
// version: 3
// version: 4
fn identities() -> std::option::Option<(ksp_store_lib::RawNetworkId, ksp_worker_api::WorkerId)> {
let network_result = ksp_store_lib::RawNetworkId::new("mainnet");
@@ -28,7 +28,7 @@ fn pre_003_defaults_are_exact_and_preserve_typed_identity() {
assert_eq!(settings.worker_id(), &worker_id);
assert_eq!(settings.admission_queue_capacity(), 256);
assert_eq!(settings.persistence_concurrency(), 8);
assert_eq!(settings.shutdown_drain_timeout(), std::time::Duration::from_secs(5));
assert_eq!(settings.shutdown_drain_timeout(), std::time::Duration::from_secs(10));
assert_eq!(crate::DEFAULT_RAW_TRANSACTION_INGEST_ADMISSION_QUEUE_CAPACITY, 256);
assert_eq!(crate::DEFAULT_RAW_TRANSACTION_INGEST_PERSISTENCE_CONCURRENCY, 8);
assert_eq!(crate::DEFAULT_RAW_TRANSACTION_INGEST_SHUTDOWN_DRAIN_TIMEOUT, std::time::Duration::from_secs(10));