v0.3.12-pre.004-fix.001
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
# file: Cargo.toml
|
||||
# version: 523
|
||||
# version: 524
|
||||
|
||||
[workspace]
|
||||
resolver = "3"
|
||||
members = ["crates/ksp-app-backfill-desk", "crates/ksp-app-config-desk", "crates/ksp-app-solprices-desk", "crates/ksp-app-store-desk", "crates/ksp-app-wallet-desk", "crates/ksp-config-lib", "crates/ksp-core-lib", "crates/ksp-interface-lib", "crates/ksp-job-api", "crates/ksp-job-backfill-lib", "crates/ksp-logging-lib", "crates/ksp-offchain-transport-lib", "crates/ksp-onchain-transport-lib", "crates/ksp-program-api", "crates/ksp-raw-transaction-lib", "crates/ksp-store-api", "crates/ksp-store-lib", "crates/ksp-store-postgres-lib", "crates/ksp-wallet-lib", "crates/ksp-worker-api", "crates/ksp-worker-raw-transaction-ingest-lib"]
|
||||
|
||||
[workspace.package]
|
||||
version = "0.3.12-pre.4"
|
||||
version = "0.3.12-pre.4.fix.1"
|
||||
edition = "2024"
|
||||
license = "MIT"
|
||||
repository = "https://git.sasedev.com/Sasedev/khadhroony-solana-project"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// file: crates/ksp-worker-raw-transaction-ingest-lib/src/runtime_resources.rs
|
||||
// version: 4
|
||||
// version: 5
|
||||
|
||||
#[cfg(test)]
|
||||
use sha2::Digest; // rust-rules: trait-import
|
||||
@@ -386,7 +386,7 @@ fn project_yellowstone_signal<T: RawTransactionIngestYellowstoneSignalView>(
|
||||
|
||||
#[cfg(test)]
|
||||
enum RawTransactionIngestHydrationOutcome {
|
||||
Available(crate::RawTransactionIngress),
|
||||
Available(std::boxed::Box<crate::RawTransactionIngress>),
|
||||
Missing(ksp_store_lib::RawTransactionReference),
|
||||
}
|
||||
|
||||
@@ -434,12 +434,11 @@ async fn hydrate_yellowstone_signal(
|
||||
if transaction.slot() != signal.slot {
|
||||
return std::result::Result::Err(crate::runtime_error("hydration.slot_mismatch"));
|
||||
}
|
||||
if let std::option::Option::Some(expected_index) = signal.transaction_index {
|
||||
if let ksp_onchain_transport_lib::SolanaWireField::Value(actual_index) = transaction.transaction_index() {
|
||||
if expected_index != u64::from(*actual_index) {
|
||||
return std::result::Result::Err(crate::runtime_error("hydration.transaction_index_mismatch"));
|
||||
}
|
||||
}
|
||||
if let std::option::Option::Some(expected_index) = signal.transaction_index
|
||||
&& let ksp_onchain_transport_lib::SolanaWireField::Value(actual_index) = transaction.transaction_index()
|
||||
&& expected_index != u64::from(*actual_index)
|
||||
{
|
||||
return std::result::Result::Err(crate::runtime_error("hydration.transaction_index_mismatch"));
|
||||
}
|
||||
let transaction_data = match transaction.transaction() {
|
||||
ksp_onchain_transport_lib::SolanaEncodedTransaction::Binary { data, encoding }
|
||||
@@ -482,12 +481,12 @@ async fn hydrate_yellowstone_signal(
|
||||
}),
|
||||
map_hydration_wire_field(transaction.transaction_index(), |value| return *value),
|
||||
);
|
||||
return std::result::Result::Ok(RawTransactionIngestHydrationOutcome::Available(crate::RawTransactionIngress {
|
||||
return std::result::Result::Ok(RawTransactionIngestHydrationOutcome::Available(std::boxed::Box::new(crate::RawTransactionIngress {
|
||||
material,
|
||||
network: signal.network,
|
||||
provenance,
|
||||
source_key,
|
||||
}));
|
||||
})));
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// file: crates/ksp-worker-raw-transaction-ingest-lib/unit_tests/runtime_resources.rs
|
||||
// version: 3
|
||||
// version: 4
|
||||
|
||||
fn grpc_endpoint(cluster: &str) -> std::option::Option<ksp_onchain_transport_lib::YellowstoneGrpcEndpointSettings> {
|
||||
return grpc_endpoint_with_identity(cluster, "yellowstone-fixture", "fixture-provider");
|
||||
@@ -749,7 +749,7 @@ async fn pre_004_observed_get_transaction_closes_signal_to_common_raw_ingress_wi
|
||||
assert_eq!(ingress.provenance.filter_id().map(ksp_store_lib::RawProvenanceCode::as_str), std::option::Option::Some("tx-fixture"));
|
||||
assert_eq!(ingress.provenance.observed_at().map(|value| return value.unix_millis()), std::option::Option::Some(1_760_000_123_456));
|
||||
let (mut admission, sender) = crate::RawTransactionAdmission::new(1);
|
||||
if sender.send(ingress).await.is_err() {
|
||||
if sender.send(*ingress).await.is_err() {
|
||||
return;
|
||||
}
|
||||
std::mem::drop(sender);
|
||||
@@ -896,7 +896,7 @@ async fn pre_004_v0_null_and_omitted_wire_fields_preserve_common_raw_semantics()
|
||||
assert!(filter_id.starts_with("sha256."));
|
||||
assert_eq!(filter_id.len(), 71);
|
||||
let (mut admission, sender) = crate::RawTransactionAdmission::new(1);
|
||||
if sender.send(ingress).await.is_err() {
|
||||
if sender.send(*ingress).await.is_err() {
|
||||
return;
|
||||
}
|
||||
std::mem::drop(sender);
|
||||
|
||||
97
deltas/0.3.12/pre.004-fix.001.md
Normal file
97
deltas/0.3.12/pre.004-fix.001.md
Normal file
@@ -0,0 +1,97 @@
|
||||
<!-- file: deltas/0.3.12/pre.004-fix.001.md -->
|
||||
<!-- version: 1 -->
|
||||
|
||||
# Delta `0.3.12-pre.004-fix.001` — correction du gate Clippy strict
|
||||
|
||||
## Base requise
|
||||
|
||||
```text
|
||||
0.3.12-pre.004
|
||||
workspace.package.version = 0.3.12-pre.4
|
||||
```
|
||||
|
||||
Le gate opérateur communiqué confirme :
|
||||
|
||||
```text
|
||||
Rust rule audit : clean
|
||||
Markdown table audit : clean (340 tables, 806 fichiers)
|
||||
cargo check --workspace : PASS
|
||||
cargo test -p ksp-raw-transaction-lib : PASS
|
||||
cargo test -p ksp-worker-raw-transaction-ingest-lib : PASS
|
||||
```
|
||||
|
||||
Le seul gate rouge est :
|
||||
|
||||
```text
|
||||
cargo clippy --workspace --all-targets --all-features -- -D warnings
|
||||
```
|
||||
|
||||
avec `clippy::large_enum_variant` et deux occurrences de `clippy::collapsible_if` dans `runtime_resources.rs`.
|
||||
|
||||
## Objectif
|
||||
|
||||
Corriger exclusivement ces trois diagnostics sans `#[allow(...)]`, sans `#[expect(...)]`, sans changer le comportement de hydration et sans avancer le scope de `pre.005`.
|
||||
|
||||
## Version
|
||||
|
||||
```text
|
||||
workspace.package.version = 0.3.12-pre.4.fix.1
|
||||
```
|
||||
|
||||
## Corrections
|
||||
|
||||
`RawTransactionIngestHydrationOutcome::Available` devient :
|
||||
|
||||
```text
|
||||
Available(Box<RawTransactionIngress>)
|
||||
```
|
||||
|
||||
La box ne concerne que ce résultat privé `#[cfg(test)]`; elle supprime la disproportion de taille entre `Available` et `Missing`. Les unit tests déplacent explicitement l'ingress hors de la box avant admission.
|
||||
|
||||
Le contrôle `transaction_index` utilise désormais une chaîne `if let` Rust 2024 unique. Il conserve exactement la règle précédente : un mismatch n'est rejeté que si le signal possède un index et si la réponse HTTP fournit un `SolanaWireField::Value` différent. `Omitted` et `Null` restent acceptés comme absence d'index HTTP comparable.
|
||||
|
||||
## Fichiers ajoutés
|
||||
|
||||
```text
|
||||
deltas/0.3.12/pre.004-fix.001.md
|
||||
```
|
||||
|
||||
## Fichiers modifiés
|
||||
|
||||
```text
|
||||
Cargo.toml
|
||||
crates/ksp-worker-raw-transaction-ingest-lib/src/runtime_resources.rs
|
||||
crates/ksp-worker-raw-transaction-ingest-lib/unit_tests/runtime_resources.rs
|
||||
docs/validation/029-V0_3_12_YELLOWSTONE_HYDRATION_CONTINUITY.md
|
||||
```
|
||||
|
||||
## Fichiers supprimés
|
||||
|
||||
Aucun.
|
||||
|
||||
## Non-changements
|
||||
|
||||
```text
|
||||
aucune API publique
|
||||
aucune dépendance
|
||||
aucun changement de provenance
|
||||
aucune politique retry Worker
|
||||
aucun Block / BlockMeta / Slot
|
||||
aucun source task Yellowstone productif
|
||||
aucune continuité / replay
|
||||
aucun lint neutralisé
|
||||
```
|
||||
|
||||
## Gate opérateur requis
|
||||
|
||||
```bash
|
||||
cargo fmt --all
|
||||
python3 scripts/audit_rust_workspace_rules.py
|
||||
python3 scripts/audit_markdown_tables.py README.md RULES.md ROADMAP.md CHANGELOG.md docs prompts crates deltas
|
||||
cargo check --workspace
|
||||
cargo clippy --workspace --all-targets --all-features -- -D warnings
|
||||
cargo test -p ksp-raw-transaction-lib
|
||||
cargo test -p ksp-worker-raw-transaction-ingest-lib
|
||||
```
|
||||
|
||||
Après gate vert, la suite reste `pre.005`.
|
||||
@@ -1,5 +1,5 @@
|
||||
<!-- file: docs/validation/029-V0_3_12_YELLOWSTONE_HYDRATION_CONTINUITY.md -->
|
||||
<!-- version: 7 -->
|
||||
<!-- version: 8 -->
|
||||
|
||||
# Validation v0.3.12 — Yellowstone + hydration HTTP + continuité de run du Worker RawTransaction
|
||||
|
||||
@@ -947,3 +947,24 @@ exécuté un smoke live Worker
|
||||
|
||||
La tranche suivante reste `pre.005` : adapters Block transactionnels et signaux continuity-only BlockMeta/Slot, toujours sans politique reconnect Worker.
|
||||
|
||||
## 40. Fix `pre.004-fix.001` — gate Clippy strict
|
||||
|
||||
Le gate opérateur de `pre.004` confirme que `cargo check --workspace`, les audits et les suites de tests `ksp-raw-transaction-lib` / `ksp-worker-raw-transaction-ingest-lib` passent. En revanche, `cargo clippy --workspace --all-targets --all-features -- -D warnings` échoue sur trois diagnostics dans la chaîne de hydration test-only :
|
||||
|
||||
```text
|
||||
clippy::large_enum_variant sur RawTransactionIngestHydrationOutcome
|
||||
clippy::collapsible_if sur le contrôle optionnel transaction_index
|
||||
clippy::collapsible_if sur le même contrôle imbriqué
|
||||
```
|
||||
|
||||
Le correctif ne neutralise aucun lint. `Available` stocke désormais `RawTransactionIngress` derrière `Box`, ce qui réduit la taille de l'enum de résultat test-only sans modifier le contrat fonctionnel. Les deux canaris qui transfèrent ensuite l'ingress vers `RawTransactionAdmission` déplacent explicitement la valeur hors de la box.
|
||||
|
||||
Le contrôle d'index est réécrit avec une chaîne `if let` Rust 2024 unique : le mismatch n'est signalé que lorsque le signal possède un index, que la réponse HTTP fournit un index concret et que les deux valeurs diffèrent. La sémantique de `Omitted`/`Null` reste inchangée.
|
||||
|
||||
Version du workspace après correctif :
|
||||
|
||||
```text
|
||||
0.3.12-pre.4.fix.1
|
||||
```
|
||||
|
||||
Aucune API publique, dépendance, provenance, politique retry, surface Block/continuity ou source task productive n'est modifiée.
|
||||
|
||||
Reference in New Issue
Block a user