v0.3.13-pre.005
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
// file: crates/ksp-worker-raw-transaction-ingest-lib/tests/dependency_boundary.rs
|
||||
// version: 20
|
||||
// version: 21
|
||||
|
||||
//! Dependency firewall canaries for the RAW transaction ingest Worker foundation.
|
||||
|
||||
@@ -296,6 +296,44 @@ fn v0_3_13_pre_004_standard_block_source_is_direct_raw_and_transport_facade_only
|
||||
return;
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn v0_3_13_pre_005_helius_transaction_source_reuses_transport_facade_and_common_hydration_only() {
|
||||
let root = include_str!("../src/lib.rs");
|
||||
let runtime = include_str!("../src/runtime.rs");
|
||||
let resources = include_str!("../src/runtime_resources.rs");
|
||||
for required in [
|
||||
"RawTransactionIngestHeliusTransactionSource",
|
||||
"HeliusLaserStreamWsSession::connect",
|
||||
".transaction_subscribe(",
|
||||
"HeliusTransactionSubscribeOptions::new",
|
||||
"HeliusTransactionSubscribeEncoding::Base64",
|
||||
"SolanaTransactionDetails::Full",
|
||||
"std::option::Option::Some(1)",
|
||||
"project_helius_transaction_signal",
|
||||
"helius_ws_http",
|
||||
"get_transaction_observed",
|
||||
"max_pending_signals: settings.admission_queue_capacity()",
|
||||
] {
|
||||
assert!(resources.contains(required), "required pre.005 Helius transaction contract missing: {required}");
|
||||
}
|
||||
assert_eq!(resources.matches("get_transaction_observed(").count(), 1);
|
||||
for forbidden in [
|
||||
"ksp_config_lib::",
|
||||
"ksp_job_backfill_lib::",
|
||||
"ksp_store_postgres_lib::",
|
||||
"reqwest::",
|
||||
"tokio_tungstenite::",
|
||||
"helius_sdk",
|
||||
"unbounded_channel",
|
||||
] {
|
||||
assert!(
|
||||
!runtime.contains(forbidden) && !resources.contains(forbidden) && !root.contains(forbidden),
|
||||
"pre.005 crossed a forbidden Helius transaction boundary: {forbidden}",
|
||||
);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
fn runtime_contains(value: &str) -> bool {
|
||||
return include_str!("../src/runtime.rs").contains(value);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// file: crates/ksp-worker-raw-transaction-ingest-lib/tests/hardening.rs
|
||||
// version: 13
|
||||
// version: 14
|
||||
|
||||
//! External public, security, redaction and release-boundary hardening canaries for `pre.010`.
|
||||
|
||||
@@ -612,6 +612,46 @@ fn v0_3_13_pre_004_standard_block_redaction_version_and_null_guards_are_explicit
|
||||
return;
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn v0_3_13_pre_005_helius_transaction_redaction_full_reference_and_tier_neutrality_are_explicit() {
|
||||
let resources = include_str!("../src/runtime_resources.rs");
|
||||
for required in [
|
||||
"RawTransactionIngestHeliusTransactionSource",
|
||||
".field(\"filter\"",
|
||||
".field(\"filter_fingerprint_bytes\"",
|
||||
".field(\"source_key_bytes\"",
|
||||
"HeliusTransactionNotification::Full(value)",
|
||||
"source.helius_transaction_notification_unqualified",
|
||||
"project_helius_transaction_signal",
|
||||
"transaction_index: std::option::Option::Some(response.transaction_index())",
|
||||
"RAW_TRANSACTION_INGEST_HELIUS_TRANSACTION_HTTP_PROTOCOL",
|
||||
] {
|
||||
assert!(resources.contains(required), "required pre.005 Helius hardening guard missing: {required}");
|
||||
}
|
||||
let source_struct = match resources.split_once("pub struct RawTransactionIngestHeliusTransactionSource {") {
|
||||
std::option::Option::Some((_, tail)) => match tail.split_once("impl crate::RawTransactionIngestHeliusTransactionSource") {
|
||||
std::option::Option::Some((value, _)) => value,
|
||||
std::option::Option::None => "",
|
||||
},
|
||||
std::option::Option::None => "",
|
||||
};
|
||||
for forbidden in ["url:", "api_key", "credential", "transaction:", "payload:", "tier:"] {
|
||||
assert!(!source_struct.contains(forbidden), "sensitive/provider material stored in Helius transaction source: {forbidden}");
|
||||
}
|
||||
let projection = match resources.split_once("fn project_helius_transaction_signal") {
|
||||
std::option::Option::Some((_, tail)) => match tail.split_once("trait RawTransactionIngestStandardLogsView") {
|
||||
std::option::Option::Some((value, _)) => value,
|
||||
std::option::Option::None => "",
|
||||
},
|
||||
std::option::Option::None => "",
|
||||
};
|
||||
assert!(!projection.contains(".transaction()"), "Helius nested full payload must not enter Worker projection");
|
||||
for forbidden in ["Developer", "Business", "Professional", "paid_tier", "provider_tier"] {
|
||||
assert!(!resources.contains(forbidden), "provider tier must not be coded in Worker: {forbidden}");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn v0_3_12_pre_009_hydration_retry_ownership_and_no_orphan_cleanup_are_explicit() {
|
||||
let resources = include_str!("../src/runtime_resources.rs");
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// file: crates/ksp-worker-raw-transaction-ingest-lib/tests/public_api.rs
|
||||
// version: 14
|
||||
// version: 15
|
||||
|
||||
//! External public-surface proofs for the RAW transaction ingest Worker foundation.
|
||||
|
||||
@@ -224,6 +224,33 @@ fn v0_3_13_pre_003_standard_logs_runtime_resource_surface_is_typed_and_transport
|
||||
return;
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn v0_3_13_pre_005_helius_transaction_runtime_resource_surface_is_typed_and_transport_owned() {
|
||||
let _source_new: fn(
|
||||
ksp_onchain_transport_lib::WsEndpointSettings,
|
||||
ksp_onchain_transport_lib::HeliusTransactionSubscribeFilter,
|
||||
ksp_onchain_transport_lib::SolanaCommitment,
|
||||
ksp_onchain_transport_lib::HttpTransportPool,
|
||||
ksp_onchain_transport_lib::HttpRoleName,
|
||||
) -> ksp_core_lib::Result<ksp_worker_raw_transaction_ingest_lib::RawTransactionIngestHeliusTransactionSource> =
|
||||
ksp_worker_raw_transaction_ingest_lib::RawTransactionIngestHeliusTransactionSource::new;
|
||||
let _resources_from_helius: fn(
|
||||
ksp_worker_raw_transaction_ingest_lib::RawTransactionIngestHeliusTransactionSource,
|
||||
) -> ksp_worker_raw_transaction_ingest_lib::RawTransactionIngestRuntimeResources =
|
||||
ksp_worker_raw_transaction_ingest_lib::RawTransactionIngestRuntimeResources::from_helius_transaction_source;
|
||||
let _push_helius: fn(
|
||||
&mut ksp_worker_raw_transaction_ingest_lib::RawTransactionIngestRuntimeResources,
|
||||
ksp_worker_raw_transaction_ingest_lib::RawTransactionIngestHeliusTransactionSource,
|
||||
) -> ksp_core_lib::Result<()> = ksp_worker_raw_transaction_ingest_lib::RawTransactionIngestRuntimeResources::try_push_helius_transaction_source;
|
||||
let root = include_str!("../src/lib.rs");
|
||||
let resources = include_str!("../src/runtime_resources.rs");
|
||||
assert!(root.contains("RawTransactionIngestHeliusTransactionSource"));
|
||||
for forbidden in ["pub fn ws_endpoint(", "pub fn filter(", "pub fn http_pool(", "pub fn source_key("] {
|
||||
assert!(!resources.contains(forbidden), "Helius transaction source implementation escape hatch present: {forbidden}");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn v0_3_13_pre_004_standard_block_runtime_resource_surface_is_typed_and_transport_owned() {
|
||||
let _source_new: fn(
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// file: crates/ksp-worker-raw-transaction-ingest-lib/tests/release_completeness.rs
|
||||
// version: 12
|
||||
// version: 13
|
||||
|
||||
//! Release-completeness canaries through the `pre.010` public/release/security hardening tranche.
|
||||
|
||||
@@ -78,6 +78,7 @@ fn pre_010_public_root_export_inventory_is_exact() {
|
||||
"MIN_RAW_TRANSACTION_INGEST_SHUTDOWN_DRAIN_TIMEOUT",
|
||||
"RAW_TRANSACTION_INGEST_WORKER_KIND_CODE",
|
||||
"RawTransactionIngestHandle",
|
||||
"RawTransactionIngestHeliusTransactionSource",
|
||||
"RawTransactionIngestRuntimeResources",
|
||||
"RawTransactionIngestSettings",
|
||||
"RawTransactionIngestSnapshot",
|
||||
@@ -117,6 +118,7 @@ fn pre_010_external_hardening_suite_is_present_and_scoped() {
|
||||
"v0_3_12_pre_002_public_root_exposes_contract_types_without_transport_implementation_paths",
|
||||
"v0_3_13_pre_003_standard_logs_redaction_and_reference_only_contract_are_explicit",
|
||||
"v0_3_13_pre_004_standard_block_redaction_version_and_null_guards_are_explicit",
|
||||
"v0_3_13_pre_005_helius_transaction_redaction_full_reference_and_tier_neutrality_are_explicit",
|
||||
] {
|
||||
assert!(hardening.contains(required), "required pre.010 hardening canary missing: {required}");
|
||||
}
|
||||
@@ -132,6 +134,7 @@ fn pre_010_external_hardening_suite_is_present_and_scoped() {
|
||||
assert!(dependency_boundary.contains("v0_3_12_pre_008_worker_observes_transport_reconnect_replay_and_faults_only_on_proven_retention_gap"));
|
||||
assert!(dependency_boundary.contains("v0_3_13_pre_003_standard_logs_source_reuses_transport_facades_and_common_hydration_only"));
|
||||
assert!(dependency_boundary.contains("v0_3_13_pre_004_standard_block_source_is_direct_raw_and_transport_facade_only"));
|
||||
assert!(dependency_boundary.contains("v0_3_13_pre_005_helius_transaction_source_reuses_transport_facade_and_common_hydration_only"));
|
||||
let public_api = include_str!("public_api.rs");
|
||||
assert!(public_api.contains("pre_003_kind_code_and_settings_are_consumable_from_crate_root"));
|
||||
assert!(public_api.contains("pre_004_start_handle_and_terminal_future_are_consumable_without_public_join_handle"));
|
||||
|
||||
Reference in New Issue
Block a user