v0.3.12-pre.007
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
// file: crates/ksp-worker-raw-transaction-ingest-lib/tests/hardening.rs
|
||||
// version: 8
|
||||
// version: 9
|
||||
|
||||
//! External public, security, redaction and release-boundary hardening canaries for `pre.010`.
|
||||
|
||||
@@ -121,16 +121,7 @@ fn v0_3_12_pre_002_manifest_dependency_surface_opens_only_transport_and_remains_
|
||||
}
|
||||
assert_eq!(
|
||||
normal,
|
||||
std::collections::BTreeSet::from([
|
||||
"ksp-core-lib",
|
||||
"ksp-logging-lib",
|
||||
"ksp-onchain-transport-lib",
|
||||
"ksp-raw-transaction-lib",
|
||||
"ksp-store-lib",
|
||||
"ksp-worker-api",
|
||||
"sha2",
|
||||
"tokio",
|
||||
])
|
||||
std::collections::BTreeSet::from(["ksp-core-lib", "ksp-logging-lib", "ksp-onchain-transport-lib", "ksp-raw-transaction-lib", "ksp-store-lib", "ksp-worker-api", "sha2", "tokio",])
|
||||
);
|
||||
assert!(dev.is_empty());
|
||||
assert!(build.is_empty());
|
||||
@@ -332,7 +323,14 @@ fn v0_3_12_pre_004_hydration_provenance_and_remote_material_are_bounded_and_reda
|
||||
] {
|
||||
assert!(resources.contains(required), "required pre.004 bounded provenance/mismatch guard missing: {required}");
|
||||
}
|
||||
for forbidden in ["source_payload_hash", "source_payload_size_bytes", "HTTP-SECRET-CANARY", "GRPC-SECRET-CANARY", "TransactionStatus.error", ".error()"] {
|
||||
for forbidden in [
|
||||
"source_payload_hash",
|
||||
"source_payload_size_bytes",
|
||||
"HTTP-SECRET-CANARY",
|
||||
"GRPC-SECRET-CANARY",
|
||||
"TransactionStatus.error",
|
||||
".error()",
|
||||
] {
|
||||
assert!(!resources.contains(forbidden), "pre.004 retained forbidden remote/source material: {forbidden}");
|
||||
}
|
||||
return;
|
||||
@@ -385,12 +383,11 @@ fn v0_3_12_pre_005_block_and_continuity_shapes_are_bounded_redacted_and_raw_sepa
|
||||
fn v0_3_12_pre_006_runtime_resource_contract_opens_one_supervised_transport_source() {
|
||||
let resources = include_str!("../src/runtime_resources.rs");
|
||||
let runtime = include_str!("../src/runtime.rs");
|
||||
for required in ["open_standard_subscribe", "next_update", "get_transaction_observed", "RawTransactionIngestHydrationCoordinator", "session.close().await"]
|
||||
{
|
||||
for required in ["open_standard_subscribe", "next_update", "get_transaction_observed", "RawTransactionIngestHydrationCoordinator", "session.close().await"] {
|
||||
assert!(resources.contains(required), "productive runtime-resource source behavior missing: {required}");
|
||||
}
|
||||
assert!(runtime.contains("start_with_runtime_resources"));
|
||||
assert!(runtime.contains("source.run(source_settings, stop_receiver, admission_sender)"));
|
||||
assert!(runtime.contains("source.run(source_settings, stop_receiver, admission_sender, processing_frontier_sender)"));
|
||||
for forbidden in ["get_block_observed", "ksp_config_lib::", "ksp_store_postgres_lib::", "reqwest::", "tonic::", "yellowstone_grpc_proto::"] {
|
||||
assert!(!resources.contains(forbidden) && !runtime.contains(forbidden), "pre.006 runtime source crossed a forbidden boundary: {forbidden}");
|
||||
}
|
||||
@@ -455,3 +452,42 @@ fn v0_3_12_pre_002_public_root_exposes_contract_types_without_transport_implemen
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn v0_3_12_pre_007_processing_frontier_is_bounded_processing_only_and_redacted() {
|
||||
let resources = include_str!("../src/runtime_resources.rs");
|
||||
let snapshot = include_str!("../src/snapshot.rs");
|
||||
for required in [
|
||||
"pending_total",
|
||||
"std::collections::BTreeMap<u64, RawTransactionIngestProcessingSlotState>",
|
||||
"settled_interval_highs",
|
||||
"oldest_pending_slot",
|
||||
"processing_frontier_slot",
|
||||
"hydration_pending",
|
||||
"processing_frontier.observe_pending",
|
||||
"processing_frontier.settle_pending",
|
||||
] {
|
||||
assert!(resources.contains(required) || snapshot.contains(required), "required pre.007 bounded frontier guard missing: {required}");
|
||||
}
|
||||
for forbidden in [
|
||||
"signature: ksp_store_lib::RawTransactionSignature",
|
||||
"filter_id",
|
||||
"provider",
|
||||
"endpoint_id",
|
||||
"transaction:",
|
||||
"meta:",
|
||||
"ReplayInfo",
|
||||
"continuity_gap",
|
||||
"repair",
|
||||
] {
|
||||
let projection = match snapshot.split_once("struct RawTransactionIngestProcessingFrontierProjection {") {
|
||||
std::option::Option::Some((_, tail)) => match tail.split_once("impl crate::RawTransactionIngestProcessingFrontierProjection") {
|
||||
std::option::Option::Some((value, _)) => value,
|
||||
std::option::Option::None => "",
|
||||
},
|
||||
std::option::Option::None => "",
|
||||
};
|
||||
assert!(!projection.contains(forbidden), "frontier projection leaked forbidden material: {forbidden}");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user