0.3.15-pre.010-fix.001
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
// file: crates/ksp-worker-raw-transaction-ingest-lib/src/snapshot.rs
|
||||
// version: 9
|
||||
// version: 10
|
||||
|
||||
/// Runtime-neutral boxed future resolving to one newer concrete RAW transaction ingest Worker snapshot.
|
||||
pub type RawTransactionIngestSnapshotFuture<'a> =
|
||||
@@ -533,6 +533,36 @@ impl crate::RawTransactionIngestSnapshot {
|
||||
return &self.worker;
|
||||
}
|
||||
|
||||
/// Reports whether continuity policy has emitted a run-local health projection.
|
||||
#[must_use]
|
||||
pub const fn continuity_policy_observed(&self) -> bool {
|
||||
return self.continuity_policy_observed;
|
||||
}
|
||||
|
||||
/// Returns the latest run-local continuity frontier when continuity policy has observed one.
|
||||
#[must_use]
|
||||
pub const fn continuity_frontier_slot(&self) -> std::option::Option<u64> {
|
||||
return self.continuity_frontier_slot;
|
||||
}
|
||||
|
||||
/// Reports whether the continuity policy currently retains one or more open gaps.
|
||||
#[must_use]
|
||||
pub const fn continuity_has_open_gaps(&self) -> bool {
|
||||
return self.continuity_has_open_gaps;
|
||||
}
|
||||
|
||||
/// Reports whether all failed-source continuity obligations have been reconciled for this run.
|
||||
#[must_use]
|
||||
pub const fn failed_source_losses_reconciled(&self) -> bool {
|
||||
return self.failed_source_losses_reconciled;
|
||||
}
|
||||
|
||||
/// Reports whether current source coverage proves the active target can continue into future slots.
|
||||
#[must_use]
|
||||
pub const fn future_target_coverage(&self) -> bool {
|
||||
return self.future_target_coverage;
|
||||
}
|
||||
|
||||
/// Returns the configured bounded admission queue capacity.
|
||||
#[must_use]
|
||||
pub const fn admission_queue_capacity(&self) -> usize {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// file: crates/ksp-worker-raw-transaction-ingest-lib/unit_tests/snapshot.rs
|
||||
// version: 7
|
||||
// version: 8
|
||||
|
||||
fn snapshot_foundation_with_source_total(
|
||||
source_total: usize,
|
||||
@@ -346,3 +346,24 @@ fn v0_3_14_pre_011_snapshot_carries_checked_gap_observability() {
|
||||
assert_eq!(snapshot.oldest_open_gap_start_slot(), std::option::Option::Some(100));
|
||||
return;
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn v0_3_15_pre_010_public_continuity_health_getters_are_source_neutral() {
|
||||
let (mut publisher, source) = match snapshot_foundation_with_source_total(2) {
|
||||
std::option::Option::Some(value) => value,
|
||||
std::option::Option::None => return,
|
||||
};
|
||||
let projection = crate::RawTransactionIngestProcessingFrontierProjection::new(0, std::option::Option::Some(90), std::option::Option::None)
|
||||
.with_source_continuity(std::option::Option::Some(crate::RawTransactionIngestSourceState::Active), 1, 1, 0)
|
||||
.with_source_counts(2, 2, 0, 0)
|
||||
.with_continuity_health(std::option::Option::Some(90), false, true)
|
||||
.with_failed_source_losses_reconciled(true);
|
||||
assert!(publisher.record_processing_frontier(ksp_worker_api::WorkerState::Running, 0, 0, projection).is_ok());
|
||||
let snapshot = source.current();
|
||||
assert!(snapshot.continuity_policy_observed());
|
||||
assert_eq!(snapshot.continuity_frontier_slot(), std::option::Option::Some(90));
|
||||
assert!(!snapshot.continuity_has_open_gaps());
|
||||
assert!(snapshot.failed_source_losses_reconciled());
|
||||
assert!(snapshot.future_target_coverage());
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user