v0.3.13-pre.004

This commit is contained in:
2026-09-10 14:25:30 +02:00
parent 31c0a83e51
commit 28e4da3879
13 changed files with 1303 additions and 33 deletions

View File

@@ -1,5 +1,5 @@
// file: crates/ksp-worker-raw-transaction-ingest-lib/tests/hardening.rs
// version: 12
// version: 13
//! External public, security, redaction and release-boundary hardening canaries for `pre.010`.
@@ -161,7 +161,12 @@ fn pre_010_source_visibility_contract_uses_crate_root_for_shared_items() {
(include_str!("../src/persistence.rs"), &["RawTransactionIngestPersistenceOutcome", "RawTransactionIngestPersistencePort"]),
(
include_str!("../src/runtime_resources.rs"),
&["RawTransactionIngestStandardLogsSource", "RawTransactionIngestYellowstoneSource", "RawTransactionIngestRuntimeResources"],
&[
"RawTransactionIngestStandardBlockSource",
"RawTransactionIngestStandardLogsSource",
"RawTransactionIngestYellowstoneSource",
"RawTransactionIngestRuntimeResources",
],
),
];
for (source, symbols) in source_contracts {
@@ -566,6 +571,47 @@ fn v0_3_13_pre_003_standard_logs_redaction_and_reference_only_contract_are_expli
return;
}
#[test]
fn v0_3_13_pre_004_standard_block_redaction_version_and_null_guards_are_explicit() {
let resources = include_str!("../src/runtime_resources.rs");
for required in [
"RawTransactionIngestStandardBlockSource",
".field(\"filter_kind\"",
".field(\"filter_fingerprint_bytes\"",
".field(\"source_key_bytes\"",
"source.standard_block_context_slot_mismatch",
"source.standard_block_remote_error",
"source.standard_block_missing",
"source.standard_block_transactions_missing",
"source.standard_block_transaction_version_unsupported",
"source.standard_block_transaction_version_unqualified",
"SolanaTransactionVersion::Number(0)",
"SolanaTransactionVersion::Number(1)",
] {
assert!(resources.contains(required), "required pre.004 standard block hardening guard missing: {required}");
}
let source_struct = match resources.split_once("pub struct RawTransactionIngestStandardBlockSource {") {
std::option::Option::Some((_, tail)) => match tail.split_once("impl crate::RawTransactionIngestStandardBlockSource") {
std::option::Option::Some((value, _)) => value,
std::option::Option::None => "",
},
std::option::Option::None => "",
};
for forbidden in ["err:", "block:", "transaction_data:", "url:"] {
assert!(!source_struct.contains(forbidden), "remote/raw material stored in standard block source: {forbidden}");
}
let source_impl = match resources.split_once("impl crate::RawTransactionIngestStandardBlockSource {") {
std::option::Option::Some((_, tail)) => match tail.split_once("impl std::fmt::Debug for crate::RawTransactionIngestStandardBlockSource") {
std::option::Option::Some((value, _)) => value,
std::option::Option::None => "",
},
std::option::Option::None => "",
};
assert!(!source_impl.contains("observe_pending("), "direct Standard Block source must not inflate hydration_pending");
assert!(source_impl.contains("processing_frontier.observe_settled(slot)"));
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");