v0.3.14-pre.004

This commit is contained in:
2026-09-11 22:22:51 +02:00
parent 6721a4142a
commit 1006079654
11 changed files with 624 additions and 21 deletions

View File

@@ -1,5 +1,5 @@
// file: crates/ksp-worker-raw-transaction-ingest-lib/src/runtime_resources.rs
// version: 30
// version: 31
use sha2::Digest; // rust-rules: trait-import
@@ -3635,6 +3635,8 @@ struct RawTransactionIngestProcessingFrontierReporter {
source_state: std::option::Option<crate::RawTransactionIngestSourceState>,
source_reconnect_total: u64,
source_replay_attempt_total: u64,
source_replay_delivery_total: u64,
source_replay_coverage_unproven_total: u64,
source_continuity_gap_total: u64,
source_overflow_total: u64,
websocket_incident_anchor: std::option::Option<crate::RawTransactionIngestWebSocketIncidentAnchor>,
@@ -3648,6 +3650,8 @@ impl RawTransactionIngestProcessingFrontierReporter {
source_state: std::option::Option::None,
source_reconnect_total: 0,
source_replay_attempt_total: 0,
source_replay_delivery_total: 0,
source_replay_coverage_unproven_total: 0,
source_continuity_gap_total: 0,
source_overflow_total: 0,
websocket_incident_anchor: std::option::Option::None,
@@ -3689,6 +3693,8 @@ impl RawTransactionIngestProcessingFrontierReporter {
map_yellowstone_source_state(snapshot.state()),
snapshot.reconnect_count(),
snapshot.replay_attempt_count(),
snapshot.replay_delivery_count(),
snapshot.replay_coverage_unproven_count(),
snapshot.continuity_gap_count(),
);
}
@@ -3777,23 +3783,33 @@ impl RawTransactionIngestProcessingFrontierReporter {
state: crate::RawTransactionIngestSourceState,
reconnect_total: u64,
replay_attempt_total: u64,
replay_delivery_total: u64,
replay_coverage_unproven_total: u64,
continuity_gap_total: u64,
) -> ksp_core_lib::Result<()> {
if reconnect_total < self.source_reconnect_total
|| replay_attempt_total < self.source_replay_attempt_total
|| replay_delivery_total < self.source_replay_delivery_total
|| replay_coverage_unproven_total < self.source_replay_coverage_unproven_total
|| continuity_gap_total < self.source_continuity_gap_total
{
return std::result::Result::Err(crate::runtime_error("source.continuity_counter_regression"));
}
let gap_increased = continuity_gap_total > self.source_continuity_gap_total;
let replay_coverage_unproven_increased = replay_coverage_unproven_total > self.source_replay_coverage_unproven_total;
self.source_state = std::option::Option::Some(state);
self.source_reconnect_total = reconnect_total;
self.source_replay_attempt_total = replay_attempt_total;
self.source_replay_delivery_total = replay_delivery_total;
self.source_replay_coverage_unproven_total = replay_coverage_unproven_total;
self.source_continuity_gap_total = continuity_gap_total;
self.publish();
if gap_increased {
return std::result::Result::Err(crate::runtime_error("source.continuity_gap_proven"));
}
if replay_coverage_unproven_increased {
return std::result::Result::Err(crate::runtime_error("source.replay_coverage_unproven"));
}
return std::result::Result::Ok(());
}