|
|
|
|
@@ -1,7 +1,7 @@
|
|
|
|
|
// file: crates/ksp-worker-raw-transaction-ingest-lib/tests/cross_layer_completeness.rs
|
|
|
|
|
// version: 1
|
|
|
|
|
// version: 2
|
|
|
|
|
|
|
|
|
|
//! Cross-layer completeness and security canaries for `0.3.12-pre.010`.
|
|
|
|
|
//! Cross-layer completeness and security canaries through `0.3.13-pre.012`.
|
|
|
|
|
|
|
|
|
|
fn dependency_names(manifest: &str) -> std::vec::Vec<&str> {
|
|
|
|
|
let mut section = "";
|
|
|
|
|
@@ -190,3 +190,176 @@ fn v0_3_12_pre_010_public_roots_keep_implementation_modules_private() {
|
|
|
|
|
}
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
|
fn v0_3_13_pre_012_all_five_live_source_families_share_one_worker_common_raw_store_pipeline() {
|
|
|
|
|
let transport_root = include_str!("../../ksp-onchain-transport-lib/src/lib.rs");
|
|
|
|
|
let transport_http_transactions = include_str!("../../ksp-onchain-transport-lib/src/rpc_transactions.rs");
|
|
|
|
|
let transport_http_blocks = include_str!("../../ksp-onchain-transport-lib/src/rpc_blocks.rs");
|
|
|
|
|
let transport_ws_protocol = include_str!("../../ksp-onchain-transport-lib/src/ws_protocol_session.rs");
|
|
|
|
|
let transport_grpc_stream = include_str!("../../ksp-onchain-transport-lib/src/grpc_stream.rs");
|
|
|
|
|
let worker_resources = include_str!("../src/runtime_resources.rs");
|
|
|
|
|
let worker_persistence = include_str!("../src/persistence.rs");
|
|
|
|
|
let common_raw_root = include_str!("../../ksp-raw-transaction-lib/src/lib.rs");
|
|
|
|
|
let store_root = include_str!("../../ksp-store-lib/src/lib.rs");
|
|
|
|
|
let store = include_str!("../../ksp-store-lib/src/store.rs");
|
|
|
|
|
for required in [
|
|
|
|
|
"HeliusTransaction(crate::RawTransactionIngestHeliusTransactionSource)",
|
|
|
|
|
"HttpBlockPolling(crate::RawTransactionIngestHttpBlockPollingSource)",
|
|
|
|
|
"StandardBlock(crate::RawTransactionIngestStandardBlockSource)",
|
|
|
|
|
"StandardLogs(crate::RawTransactionIngestStandardLogsSource)",
|
|
|
|
|
"Yellowstone(crate::RawTransactionIngestYellowstoneSource)",
|
|
|
|
|
"RawTransactionIngestGlobalHydrationRegistry",
|
|
|
|
|
"run_live_sources",
|
|
|
|
|
"RawTransactionIngress",
|
|
|
|
|
] {
|
|
|
|
|
assert!(worker_resources.contains(required), "pre.012 Worker source/pipeline contract missing: {required}");
|
|
|
|
|
}
|
|
|
|
|
for required in ["persist_raw_transaction_ingest_converged_acquisition", "RawTransactionIngestPersistenceConvergence", "record_observation"] {
|
|
|
|
|
assert!(worker_persistence.contains(required), "pre.012 Worker persistence contract missing: {required}");
|
|
|
|
|
}
|
|
|
|
|
for required in ["SolanaStandardWsSession", "HeliusLaserStreamWsSession"] {
|
|
|
|
|
assert!(transport_ws_protocol.contains(required), "pre.012 WS Transport facade missing: {required}");
|
|
|
|
|
}
|
|
|
|
|
assert!(transport_grpc_stream.contains("pub struct SolanaYellowstoneGrpcSubscribeSession"));
|
|
|
|
|
assert!(transport_http_transactions.contains("pub async fn get_transaction_observed("));
|
|
|
|
|
assert!(transport_http_blocks.contains("pub async fn get_block_observed("));
|
|
|
|
|
assert!(transport_http_blocks.contains("pub async fn get_blocks_with_limit("));
|
|
|
|
|
for required in ["RawTransactionAcquisition", "RawSolanaMessageVersion", "RawSolanaTransactionWire"] {
|
|
|
|
|
assert!(common_raw_root.contains(required), "pre.012 Common RAW contract missing: {required}");
|
|
|
|
|
}
|
|
|
|
|
for required in ["RawTransactionWrite", "RawTransactionObservationWrite", "RawPayload"] {
|
|
|
|
|
assert!(store_root.contains(required), "pre.012 Store facade contract missing: {required}");
|
|
|
|
|
}
|
|
|
|
|
for required in ["persist_raw_transaction_acquisition", "record_raw_transaction_observation"] {
|
|
|
|
|
assert!(store.contains(required), "pre.012 Store dispatch contract missing: {required}");
|
|
|
|
|
}
|
|
|
|
|
assert!(!transport_root.contains("ksp_raw_transaction_lib"));
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
|
fn v0_3_13_pre_012_legacy_v0_v1_is_proven_from_transport_through_worker_common_raw_to_store() {
|
|
|
|
|
let transport_grpc = include_str!("../../ksp-onchain-transport-lib/unit_tests/grpc_subscribe.rs");
|
|
|
|
|
let transport_blocks = include_str!("../../ksp-onchain-transport-lib/unit_tests/rpc_blocks.rs");
|
|
|
|
|
let worker = include_str!("../unit_tests/runtime_resources.rs");
|
|
|
|
|
let worker_resources = include_str!("../src/runtime_resources.rs");
|
|
|
|
|
let worker_persistence = include_str!("../src/persistence.rs");
|
|
|
|
|
let common_raw_wire = include_str!("../../ksp-raw-transaction-lib/unit_tests/wire.rs");
|
|
|
|
|
let common_raw_canonical = include_str!("../../ksp-raw-transaction-lib/unit_tests/canonical.rs");
|
|
|
|
|
let store_api = include_str!("../../ksp-store-api/tests/public_api.rs");
|
|
|
|
|
let store = include_str!("../../ksp-store-lib/src/store.rs");
|
|
|
|
|
assert!(transport_grpc.contains("yellowstone_transaction_update_decodes_current_storage_wire_including_v1_config_and_meta"));
|
|
|
|
|
assert!(transport_blocks.contains("typed_get_block_modern_full_config_preserves_rich_wire_and_simd_fields"));
|
|
|
|
|
for required in [
|
|
|
|
|
"v0_3_13_pre_004_standard_block_qualifies_legacy_v0_v1_and_rejects_ambiguous_or_future_versions",
|
|
|
|
|
"v0_3_13_pre_004_legacy_v0_v1_block_materials_are_direct_common_raw_with_exact_version_and_index",
|
|
|
|
|
"v0_3_13_pre_006_http_block_polling_qualifies_legacy_v0_v1_and_rejects_ambiguous_or_future_versions",
|
|
|
|
|
"RawSolanaMessageVersion::Legacy",
|
|
|
|
|
"RawSolanaMessageVersion::V0",
|
|
|
|
|
"RawSolanaMessageVersion::V1",
|
|
|
|
|
] {
|
|
|
|
|
assert!(worker.contains(required), "pre.012 Worker Legacy/V0/V1 proof missing: {required}");
|
|
|
|
|
}
|
|
|
|
|
assert!(worker_resources.contains("SolanaGetTransactionConfig::new"));
|
|
|
|
|
assert!(worker_resources.contains("std::option::Option::Some(1),"));
|
|
|
|
|
for required in [
|
|
|
|
|
"pre_006_legacy_v0_and_v1_wire_goldens_are_exact",
|
|
|
|
|
"pre_006_v1_structural_guards_reject_alt_duplicates_and_missing_config",
|
|
|
|
|
"RawSolanaMessageVersion::V1",
|
|
|
|
|
] {
|
|
|
|
|
assert!(common_raw_wire.contains(required), "pre.012 Common RAW V1 proof missing: {required}");
|
|
|
|
|
}
|
|
|
|
|
assert!(common_raw_canonical.contains("pre_002_canonical_raw_v1_golden_bytes_and_hash_are_exact"));
|
|
|
|
|
for required in ["block_time", "content_hash", "format_id", "format_version", "slot"] {
|
|
|
|
|
assert!(worker_persistence.contains(required), "pre.012 canonical Store identity field missing: {required}");
|
|
|
|
|
}
|
|
|
|
|
assert!(store_api.contains("public_pre_003_raw_transaction_and_observation_are_constructible_from_crate_root"));
|
|
|
|
|
assert!(store_api.contains("RawPayload::try_new(format, 1"));
|
|
|
|
|
assert!(store.contains("persist_raw_transaction_acquisition"));
|
|
|
|
|
assert!(store.contains("record_raw_transaction_observation"));
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
|
fn v0_3_13_pre_012_yellowstone_non_regression_covers_identity_v1_reconnect_gap_and_worker_hydration() {
|
|
|
|
|
let transport_subscribe = include_str!("../../ksp-onchain-transport-lib/unit_tests/grpc_subscribe.rs");
|
|
|
|
|
let transport_stream = include_str!("../../ksp-onchain-transport-lib/unit_tests/grpc_stream.rs");
|
|
|
|
|
let transport_public = include_str!("../../ksp-onchain-transport-lib/tests/public_api.rs");
|
|
|
|
|
let worker = include_str!("../unit_tests/runtime_resources.rs");
|
|
|
|
|
let worker_hardening = include_str!("hardening.rs");
|
|
|
|
|
for required in [
|
|
|
|
|
"yellowstone_subscribe_request_identity_is_order_stable_exact_and_debug_redacted",
|
|
|
|
|
"yellowstone_transaction_update_decodes_current_storage_wire_including_v1_config_and_meta",
|
|
|
|
|
"yellowstone_transaction_status_update_preserves_error_and_rejects_malformed_signature",
|
|
|
|
|
"yellowstone_block_update_reuses_transaction_account_entry_dtos_and_preserves_server_counts",
|
|
|
|
|
] {
|
|
|
|
|
assert!(transport_subscribe.contains(required), "pre.012 Yellowstone Transport subscribe proof missing: {required}");
|
|
|
|
|
}
|
|
|
|
|
for required in [
|
|
|
|
|
"yellowstone_reconnect_replays_from_last_observed_slot_and_counts_duplicate_identity",
|
|
|
|
|
"yellowstone_replay_info_proves_and_clamps_retention_gap_without_lossless_claim",
|
|
|
|
|
"yellowstone_shutdown_interrupts_reconnect_backoff_and_mutation_is_rejected_during_reconnect",
|
|
|
|
|
] {
|
|
|
|
|
assert!(transport_stream.contains(required), "pre.012 Yellowstone Transport lifecycle proof missing: {required}");
|
|
|
|
|
}
|
|
|
|
|
assert!(transport_public.contains("public_v0_3_13_pre_002_yellowstone_subscribe_identity_is_opaque_and_available_from_crate_root"));
|
|
|
|
|
for required in [
|
|
|
|
|
"pre_002_source_accepts_matching_confirmed_transaction_and_get_transaction_route_without_io",
|
|
|
|
|
"v0_3_13_pre_002_live_source_key_is_stable_and_request_sensitive",
|
|
|
|
|
"pre_003_transaction_signal_fixture_preserves_exact_source_neutral_identity",
|
|
|
|
|
"pre_005_block_projects_transaction_signals_in_exact_source_order",
|
|
|
|
|
"pre_005_block_meta_and_slot_project_continuity_only_without_remote_dead_error",
|
|
|
|
|
"pre_004_observed_get_transaction_closes_signal_to_common_raw_ingress_with_composite_provenance",
|
|
|
|
|
"pre_008_reconnect_replay_and_proven_gap_are_distinct_monotone_and_frontier_preserving",
|
|
|
|
|
"v0_3_13_pre_008_global_hydration_registry_coalesces_cross_source_key_to_one_leader",
|
|
|
|
|
] {
|
|
|
|
|
assert!(worker.contains(required), "pre.012 Yellowstone Worker non-regression proof missing: {required}");
|
|
|
|
|
}
|
|
|
|
|
for required in [
|
|
|
|
|
"v0_3_12_pre_003_private_signal_debug_and_shape_do_not_expose_signature_filters_or_payload",
|
|
|
|
|
"v0_3_12_pre_008_reconnect_projection_is_source_neutral_bounded_and_contains_no_replay_material",
|
|
|
|
|
] {
|
|
|
|
|
assert!(worker_hardening.contains(required), "pre.012 Yellowstone Worker hardening proof missing: {required}");
|
|
|
|
|
}
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
|
fn v0_3_13_pre_012_security_redaction_matrix_covers_all_live_sources_and_lower_layers() {
|
|
|
|
|
let transport_subscribe = include_str!("../../ksp-onchain-transport-lib/unit_tests/grpc_subscribe.rs");
|
|
|
|
|
let transport_unary = include_str!("../../ksp-onchain-transport-lib/unit_tests/grpc_unary.rs");
|
|
|
|
|
let transport_ws = include_str!("../../ksp-onchain-transport-lib/unit_tests/ws_helius_transactions.rs");
|
|
|
|
|
let worker = include_str!("hardening.rs");
|
|
|
|
|
let common_raw = include_str!("../../ksp-raw-transaction-lib/unit_tests/canonical.rs");
|
|
|
|
|
let store_api = include_str!("../../ksp-store-api/tests/security_hardening.rs");
|
|
|
|
|
let store = include_str!("../../ksp-store-lib/tests/hardening_completeness.rs");
|
|
|
|
|
let postgres = include_str!("../../ksp-store-postgres-lib/tests/hardening_completeness.rs");
|
|
|
|
|
for required in [
|
|
|
|
|
"yellowstone_subscribe_debug_omits_filter_names_and_future_payloads",
|
|
|
|
|
"yellowstone_transaction_filters_encode_complete_current_wire_and_redact_selectors",
|
|
|
|
|
] {
|
|
|
|
|
assert!(transport_subscribe.contains(required), "pre.012 Transport gRPC redaction proof missing: {required}");
|
|
|
|
|
}
|
|
|
|
|
assert!(transport_unary.contains("yellowstone_remote_status_does_not_copy_message_details_or_metadata"));
|
|
|
|
|
assert!(transport_ws.contains("helius_transaction_notification_debug_omits_raw_provider_payloads"));
|
|
|
|
|
for required in [
|
|
|
|
|
"v0_3_12_pre_003_private_signal_debug_and_shape_do_not_expose_signature_filters_or_payload",
|
|
|
|
|
"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",
|
|
|
|
|
"v0_3_13_pre_006_http_block_polling_is_bounded_run_local_stop_preemptible_and_redacted",
|
|
|
|
|
"v0_3_13_pre_007_multi_source_supervisor_is_fail_closed_joined_and_does_not_publish_source_identity",
|
|
|
|
|
"v0_3_13_pre_008_cross_source_convergence_is_bounded_conflict_checked_and_private",
|
|
|
|
|
"v0_3_13_pre_009_duplicate_storm_disagreement_and_starvation_guards_are_explicit",
|
|
|
|
|
"v0_3_13_pre_010_multi_source_health_is_conservative_counted_and_redacted",
|
|
|
|
|
"v0_3_13_pre_011_shutdown_races_are_bounded_joined_atomic_and_counter_safe",
|
|
|
|
|
] {
|
|
|
|
|
assert!(worker.contains(required), "pre.012 Worker security proof missing: {required}");
|
|
|
|
|
}
|
|
|
|
|
assert!(common_raw.contains("pre_002_material_and_wire_debug_do_not_render_transaction_or_meta_material"));
|
|
|
|
|
assert!(store_api.contains("pre_007_raw_debug_surfaces_do_not_render_payload_hash_signature_or_account_bytes"));
|
|
|
|
|
assert!(store.contains("pre_009_secret_canary_never_crosses_settings_or_pre_io_error_debug"));
|
|
|
|
|
assert!(postgres.contains("pre_009_backend_error_bridge_cannot_retain_external_error_or_secret_text"));
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|