v0.3.12-pre.006
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
// file: crates/ksp-worker-raw-transaction-ingest-lib/tests/hardening.rs
|
||||
// version: 7
|
||||
// version: 8
|
||||
|
||||
//! External public, security, redaction and release-boundary hardening canaries for `pre.010`.
|
||||
|
||||
@@ -382,17 +382,39 @@ fn v0_3_12_pre_005_block_and_continuity_shapes_are_bounded_redacted_and_raw_sepa
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn v0_3_12_pre_002_runtime_resource_contract_performs_no_live_io_or_source_spawn() {
|
||||
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 forbidden in ["open_standard_subscribe", "next_update", "get_block_observed", "tokio::spawn", "JoinSet"] {
|
||||
assert!(!resources.contains(forbidden), "runtime-resource contract opened premature live source behavior: {forbidden}");
|
||||
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!(resources.contains("#[cfg(test)]\nasync fn hydrate_yellowstone_signal"));
|
||||
assert!(resources.contains("get_transaction_observed"));
|
||||
assert!(runtime.contains("start_with_runtime_resources"));
|
||||
for forbidden in ["open_standard_subscribe", "next_update", "get_transaction_observed", "get_block_observed"] {
|
||||
assert!(!runtime.contains(forbidden), "pre.002 runtime start opened premature live behavior: {forbidden}");
|
||||
assert!(runtime.contains("source.run(source_settings, stop_receiver, admission_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}");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn v0_3_12_pre_006_source_coalescence_is_bounded_stop_preemptible_and_redacted() {
|
||||
let resources = include_str!("../src/runtime_resources.rs");
|
||||
for required in [
|
||||
"max_in_flight: settings.persistence_concurrency()",
|
||||
"max_pending_signals: crate::MAX_RAW_TRANSACTION_INGEST_ADMISSION_QUEUE_CAPACITY",
|
||||
"pending_signal_count",
|
||||
"stop_receiver.changed()",
|
||||
"tasks.abort_all()",
|
||||
"source.hydration_pending_saturated",
|
||||
"source.hydration_task_join_failed",
|
||||
"hydration_transport_error(error.code())",
|
||||
"source_transport_error(error.code())",
|
||||
] {
|
||||
assert!(resources.contains(required), "required pre.006 bounded/stop-safe source guard missing: {required}");
|
||||
}
|
||||
for forbidden in ["remote_message", "response_body", "dead_error", "TransactionStatus.error", ".error()", "Authorization", "Bearer "] {
|
||||
assert!(!resources.contains(forbidden), "remote/secret material leaked into productive source: {forbidden}");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user