v0.3.12-pre.003-fix.001
This commit is contained in:
@@ -1,12 +1,12 @@
|
|||||||
# file: Cargo.toml
|
# file: Cargo.toml
|
||||||
# version: 521
|
# version: 522
|
||||||
|
|
||||||
[workspace]
|
[workspace]
|
||||||
resolver = "3"
|
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"]
|
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]
|
[workspace.package]
|
||||||
version = "0.3.12-pre.3"
|
version = "0.3.12-pre.3.fix.1"
|
||||||
edition = "2024"
|
edition = "2024"
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
repository = "https://git.sasedev.com/Sasedev/khadhroony-solana-project"
|
repository = "https://git.sasedev.com/Sasedev/khadhroony-solana-project"
|
||||||
|
|||||||
@@ -1,10 +1,13 @@
|
|||||||
// file: crates/ksp-worker-raw-transaction-ingest-lib/src/runtime_resources.rs
|
// file: crates/ksp-worker-raw-transaction-ingest-lib/src/runtime_resources.rs
|
||||||
// version: 2
|
// version: 3
|
||||||
|
|
||||||
|
#[cfg(test)]
|
||||||
use sha2::Digest; // rust-rules: trait-import
|
use sha2::Digest; // rust-rules: trait-import
|
||||||
|
|
||||||
|
#[cfg(test)]
|
||||||
const RAW_TRANSACTION_INGEST_YELLOWSTONE_FILTER_FINGERPRINT_DOMAIN: &[u8] = b"ksp.raw_transaction_ingest.yellowstone.filters.v1\0";
|
const RAW_TRANSACTION_INGEST_YELLOWSTONE_FILTER_FINGERPRINT_DOMAIN: &[u8] = b"ksp.raw_transaction_ingest.yellowstone.filters.v1\0";
|
||||||
|
|
||||||
|
#[cfg(test)]
|
||||||
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
|
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
|
||||||
enum RawTransactionIngestSourceFamily {
|
enum RawTransactionIngestSourceFamily {
|
||||||
Transaction,
|
Transaction,
|
||||||
@@ -17,18 +20,21 @@ struct RawTransactionIngestSourceRoute {
|
|||||||
provider: ksp_store_lib::RawProvenanceCode,
|
provider: ksp_store_lib::RawProvenanceCode,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(test)]
|
||||||
#[derive(Clone, Copy, Eq, PartialEq)]
|
#[derive(Clone, Copy, Eq, PartialEq)]
|
||||||
struct RawTransactionIngestSourceTimestamp {
|
struct RawTransactionIngestSourceTimestamp {
|
||||||
nanos: u32,
|
nanos: u32,
|
||||||
seconds: i64,
|
seconds: i64,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(test)]
|
||||||
impl std::fmt::Debug for RawTransactionIngestSourceTimestamp {
|
impl std::fmt::Debug for RawTransactionIngestSourceTimestamp {
|
||||||
fn fmt(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
fn fmt(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||||
return formatter.debug_struct("RawTransactionIngestSourceTimestamp").field("nanos", &self.nanos).field("seconds", &self.seconds).finish();
|
return formatter.debug_struct("RawTransactionIngestSourceTimestamp").field("nanos", &self.nanos).field("seconds", &self.seconds).finish();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(test)]
|
||||||
#[derive(Clone, Eq, PartialEq)]
|
#[derive(Clone, Eq, PartialEq)]
|
||||||
struct RawTransactionIngestSourceSignal {
|
struct RawTransactionIngestSourceSignal {
|
||||||
created_at: std::option::Option<RawTransactionIngestSourceTimestamp>,
|
created_at: std::option::Option<RawTransactionIngestSourceTimestamp>,
|
||||||
@@ -42,6 +48,7 @@ struct RawTransactionIngestSourceSignal {
|
|||||||
transaction_index: std::option::Option<u64>,
|
transaction_index: std::option::Option<u64>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(test)]
|
||||||
impl std::fmt::Debug for RawTransactionIngestSourceSignal {
|
impl std::fmt::Debug for RawTransactionIngestSourceSignal {
|
||||||
fn fmt(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
fn fmt(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||||
return formatter
|
return formatter
|
||||||
@@ -59,6 +66,7 @@ impl std::fmt::Debug for RawTransactionIngestSourceSignal {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(test)]
|
||||||
trait RawTransactionIngestYellowstoneSignalView {
|
trait RawTransactionIngestYellowstoneSignalView {
|
||||||
fn created_at(&self) -> std::option::Option<ksp_onchain_transport_lib::YellowstoneUpdateTimestamp>;
|
fn created_at(&self) -> std::option::Option<ksp_onchain_transport_lib::YellowstoneUpdateTimestamp>;
|
||||||
|
|
||||||
@@ -73,6 +81,7 @@ trait RawTransactionIngestYellowstoneSignalView {
|
|||||||
fn slot(&self) -> u64;
|
fn slot(&self) -> u64;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(test)]
|
||||||
impl RawTransactionIngestYellowstoneSignalView for ksp_onchain_transport_lib::YellowstoneTransactionUpdate {
|
impl RawTransactionIngestYellowstoneSignalView for ksp_onchain_transport_lib::YellowstoneTransactionUpdate {
|
||||||
fn created_at(&self) -> std::option::Option<ksp_onchain_transport_lib::YellowstoneUpdateTimestamp> {
|
fn created_at(&self) -> std::option::Option<ksp_onchain_transport_lib::YellowstoneUpdateTimestamp> {
|
||||||
return ksp_onchain_transport_lib::YellowstoneTransactionUpdate::created_at(self);
|
return ksp_onchain_transport_lib::YellowstoneTransactionUpdate::created_at(self);
|
||||||
@@ -99,6 +108,7 @@ impl RawTransactionIngestYellowstoneSignalView for ksp_onchain_transport_lib::Ye
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(test)]
|
||||||
impl RawTransactionIngestYellowstoneSignalView for ksp_onchain_transport_lib::YellowstoneTransactionStatusUpdate {
|
impl RawTransactionIngestYellowstoneSignalView for ksp_onchain_transport_lib::YellowstoneTransactionStatusUpdate {
|
||||||
fn created_at(&self) -> std::option::Option<ksp_onchain_transport_lib::YellowstoneUpdateTimestamp> {
|
fn created_at(&self) -> std::option::Option<ksp_onchain_transport_lib::YellowstoneUpdateTimestamp> {
|
||||||
return ksp_onchain_transport_lib::YellowstoneTransactionStatusUpdate::created_at(self);
|
return ksp_onchain_transport_lib::YellowstoneTransactionStatusUpdate::created_at(self);
|
||||||
@@ -125,6 +135,7 @@ impl RawTransactionIngestYellowstoneSignalView for ksp_onchain_transport_lib::Ye
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(test)]
|
||||||
impl std::convert::From<(&crate::RawTransactionIngestYellowstoneSource, &ksp_onchain_transport_lib::YellowstoneTransactionUpdate)>
|
impl std::convert::From<(&crate::RawTransactionIngestYellowstoneSource, &ksp_onchain_transport_lib::YellowstoneTransactionUpdate)>
|
||||||
for RawTransactionIngestSourceSignal
|
for RawTransactionIngestSourceSignal
|
||||||
{
|
{
|
||||||
@@ -133,6 +144,7 @@ impl std::convert::From<(&crate::RawTransactionIngestYellowstoneSource, &ksp_onc
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(test)]
|
||||||
impl std::convert::From<(&crate::RawTransactionIngestYellowstoneSource, &ksp_onchain_transport_lib::YellowstoneTransactionStatusUpdate)>
|
impl std::convert::From<(&crate::RawTransactionIngestYellowstoneSource, &ksp_onchain_transport_lib::YellowstoneTransactionStatusUpdate)>
|
||||||
for RawTransactionIngestSourceSignal
|
for RawTransactionIngestSourceSignal
|
||||||
{
|
{
|
||||||
@@ -212,6 +224,7 @@ impl std::fmt::Debug for crate::RawTransactionIngestYellowstoneSource {
|
|||||||
.field("yellowstone_endpoint_name", &self.yellowstone_channel.endpoint_name())
|
.field("yellowstone_endpoint_name", &self.yellowstone_channel.endpoint_name())
|
||||||
.field("yellowstone_provider", &self.yellowstone_channel.provider().as_str())
|
.field("yellowstone_provider", &self.yellowstone_channel.provider().as_str())
|
||||||
.field("network", &self.network.as_str())
|
.field("network", &self.network.as_str())
|
||||||
|
.field("route", &self.route)
|
||||||
.field("transaction_filter_count", &self.subscribe_request.transaction_filter_count())
|
.field("transaction_filter_count", &self.subscribe_request.transaction_filter_count())
|
||||||
.field("transaction_status_filter_count", &self.subscribe_request.transaction_status_filter_count())
|
.field("transaction_status_filter_count", &self.subscribe_request.transaction_status_filter_count())
|
||||||
.field("block_filter_count", &self.subscribe_request.block_filter_count())
|
.field("block_filter_count", &self.subscribe_request.block_filter_count())
|
||||||
@@ -286,6 +299,7 @@ fn ingestion_filter_count(request: &ksp_onchain_transport_lib::YellowstoneSubscr
|
|||||||
return request.transaction_filter_count().saturating_add(request.transaction_status_filter_count()).saturating_add(request.block_filter_count());
|
return request.transaction_filter_count().saturating_add(request.transaction_status_filter_count()).saturating_add(request.block_filter_count());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(test)]
|
||||||
fn matched_filter_fingerprint(filters: &[ksp_onchain_transport_lib::YellowstoneSubscribeFilterName]) -> [u8; 32] {
|
fn matched_filter_fingerprint(filters: &[ksp_onchain_transport_lib::YellowstoneSubscribeFilterName]) -> [u8; 32] {
|
||||||
let mut names = filters.iter().map(ksp_onchain_transport_lib::YellowstoneSubscribeFilterName::as_str).collect::<std::vec::Vec<_>>();
|
let mut names = filters.iter().map(ksp_onchain_transport_lib::YellowstoneSubscribeFilterName::as_str).collect::<std::vec::Vec<_>>();
|
||||||
names.sort_unstable();
|
names.sort_unstable();
|
||||||
@@ -300,6 +314,7 @@ fn matched_filter_fingerprint(filters: &[ksp_onchain_transport_lib::YellowstoneS
|
|||||||
return hasher.finalize().into();
|
return hasher.finalize().into();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(test)]
|
||||||
fn project_yellowstone_signal<T: RawTransactionIngestYellowstoneSignalView>(
|
fn project_yellowstone_signal<T: RawTransactionIngestYellowstoneSignalView>(
|
||||||
source: &crate::RawTransactionIngestYellowstoneSource,
|
source: &crate::RawTransactionIngestYellowstoneSource,
|
||||||
update: &T,
|
update: &T,
|
||||||
|
|||||||
136
deltas/0.3.12/pre.003-fix.001.md
Normal file
136
deltas/0.3.12/pre.003-fix.001.md
Normal file
@@ -0,0 +1,136 @@
|
|||||||
|
<!-- file: deltas/0.3.12/pre.003-fix.001.md -->
|
||||||
|
<!-- version: 2 -->
|
||||||
|
|
||||||
|
# Delta `0.3.12-pre.003-fix.001` — suppression du dead code préparatoire
|
||||||
|
|
||||||
|
## Base requise
|
||||||
|
|
||||||
|
```text
|
||||||
|
0.3.12-pre.003
|
||||||
|
workspace.package.version = 0.3.12-pre.3
|
||||||
|
```
|
||||||
|
|
||||||
|
Le gate opérateur reçu pour `pre.003` montre :
|
||||||
|
|
||||||
|
```text
|
||||||
|
audit Rust : clean
|
||||||
|
audit Markdown : clean (340 tables, 803 fichiers)
|
||||||
|
cargo check --workspace : PASS visible
|
||||||
|
cargo test -p ksp-worker-raw-transaction-ingest-lib : 45 PASS, 0 fail
|
||||||
|
cargo clippy --workspace --all-targets --all-features -- -D warnings : FAIL
|
||||||
|
```
|
||||||
|
|
||||||
|
L'échec Clippy est limité à huit diagnostics `dead_code` dans `runtime_resources.rs` pour les adapters privés préparatoires de `pre.003` et le champ privé `route`.
|
||||||
|
|
||||||
|
## Objectif
|
||||||
|
|
||||||
|
Corriger exclusivement le gate Clippy de `pre.003` sans avancer le périmètre fonctionnel vers `pre.004`.
|
||||||
|
|
||||||
|
## Version
|
||||||
|
|
||||||
|
La correction touche du code Rust ; conformément à `VER-ID-007` et `VER-ID-010` :
|
||||||
|
|
||||||
|
```text
|
||||||
|
delivery id = 0.3.12-pre.003-fix.001
|
||||||
|
workspace.package.version = 0.3.12-pre.3.fix.1
|
||||||
|
```
|
||||||
|
|
||||||
|
## Correction
|
||||||
|
|
||||||
|
`RUST-API-008` exige qu'un helper strictement privé, sans consommateur de production et présent uniquement pour une préparation testée, soit compilé sous `#[cfg(test)]` jusqu'à sa première consommation réelle.
|
||||||
|
|
||||||
|
Sont donc passés sous `#[cfg(test)]` :
|
||||||
|
|
||||||
|
```text
|
||||||
|
import sha2::Digest utilisé uniquement par le fingerprint préparatoire
|
||||||
|
RAW_TRANSACTION_INGEST_YELLOWSTONE_FILTER_FINGERPRINT_DOMAIN
|
||||||
|
RawTransactionIngestSourceFamily
|
||||||
|
RawTransactionIngestSourceTimestamp + Debug
|
||||||
|
RawTransactionIngestSourceSignal + Debug
|
||||||
|
RawTransactionIngestYellowstoneSignalView
|
||||||
|
impls Transaction et TransactionStatus
|
||||||
|
impls From vers le signal privé
|
||||||
|
matched_filter_fingerprint
|
||||||
|
project_yellowstone_signal
|
||||||
|
```
|
||||||
|
|
||||||
|
Ces éléments restent présents dans la source et restent exercés par les unit tests `pre.003`; ils réentreront dans le build productif à leur première consommation réelle en `pre.004`.
|
||||||
|
|
||||||
|
Aucun `#[allow(dead_code)]` ni `#[expect(dead_code)]` n'est utilisé.
|
||||||
|
|
||||||
|
Le champ `RawTransactionIngestYellowstoneSource::route` n'est pas test-only : sa validation provider/endpoint fait déjà partie du contrat productif `pre.003`. Le `Debug` sûr de la source lit maintenant ce champ, ce qui supprime son warning sans masquer le lint.
|
||||||
|
|
||||||
|
## Décisions prises
|
||||||
|
|
||||||
|
```text
|
||||||
|
respect strict de RUST-API-008
|
||||||
|
pas de suppression des adapters testés de pre.003
|
||||||
|
pas d'élargissement de visibilité
|
||||||
|
pas d'allow/expect dead_code
|
||||||
|
route validée conservée dans la source productive
|
||||||
|
aucune activation live anticipée
|
||||||
|
```
|
||||||
|
|
||||||
|
## Questions ouvertes
|
||||||
|
|
||||||
|
Aucune. La première consommation productive des adapters reste `pre.004`.
|
||||||
|
|
||||||
|
## Fichiers ajoutés
|
||||||
|
|
||||||
|
```text
|
||||||
|
deltas/0.3.12/pre.003-fix.001.md
|
||||||
|
```
|
||||||
|
|
||||||
|
## Fichiers modifiés
|
||||||
|
|
||||||
|
```text
|
||||||
|
Cargo.toml
|
||||||
|
crates/ksp-worker-raw-transaction-ingest-lib/src/runtime_resources.rs
|
||||||
|
docs/validation/029-V0_3_12_YELLOWSTONE_HYDRATION_CONTINUITY.md
|
||||||
|
```
|
||||||
|
|
||||||
|
## Fichiers supprimés
|
||||||
|
|
||||||
|
Aucun.
|
||||||
|
|
||||||
|
## Validations exécutées dans l'environnement d'assemblage
|
||||||
|
|
||||||
|
```text
|
||||||
|
python3 scripts/audit_rust_workspace_rules.py
|
||||||
|
General Rust rule audit: clean
|
||||||
|
Rust export completeness audit: 0 candidate(s)
|
||||||
|
KSP workspace Rust rule audit: clean
|
||||||
|
python3 scripts/audit_markdown_tables.py README.md RULES.md ROADMAP.md CHANGELOG.md docs prompts crates deltas
|
||||||
|
Markdown table audit: clean (340 table(s), 804 file(s))
|
||||||
|
```
|
||||||
|
|
||||||
|
## Validations non exécutées dans l'environnement d'assemblage
|
||||||
|
|
||||||
|
`cargo`, `rustc` et `rustfmt` ne sont pas installés dans cet environnement. Aucun gate Cargo local n'est déclaré PASS.
|
||||||
|
|
||||||
|
## Gate opérateur demandé
|
||||||
|
|
||||||
|
```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-worker-raw-transaction-ingest-lib
|
||||||
|
```
|
||||||
|
|
||||||
|
## Non-claims
|
||||||
|
|
||||||
|
Ce correctif ne revendique toujours pas :
|
||||||
|
|
||||||
|
```text
|
||||||
|
stream Yellowstone ouvert
|
||||||
|
update réseau consommée
|
||||||
|
hydration HTTP
|
||||||
|
Common RAW issu du réseau
|
||||||
|
provenance composite finale
|
||||||
|
persistence réseau
|
||||||
|
Block / BlockMeta / Slot
|
||||||
|
coalescence
|
||||||
|
frontier / from_slot / ReplayInfo
|
||||||
|
```
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
<!-- file: docs/validation/029-V0_3_12_YELLOWSTONE_HYDRATION_CONTINUITY.md -->
|
<!-- file: docs/validation/029-V0_3_12_YELLOWSTONE_HYDRATION_CONTINUITY.md -->
|
||||||
<!-- version: 3 -->
|
<!-- version: 5 -->
|
||||||
|
|
||||||
# Validation v0.3.12 — Yellowstone + hydration HTTP + continuité de run du Worker RawTransaction
|
# Validation v0.3.12 — Yellowstone + hydration HTTP + continuité de run du Worker RawTransaction
|
||||||
|
|
||||||
@@ -779,3 +779,25 @@ exécuté un smoke live Worker
|
|||||||
|
|
||||||
La tranche suivante reste `pre.004` : fermeture déterministe `signal -> get_transaction_observed -> Common RAW -> ingress` avec missing/mismatch et provenance composite, sans Block ni continuité/replay.
|
La tranche suivante reste `pre.004` : fermeture déterministe `signal -> get_transaction_observed -> Common RAW -> ingress` avec missing/mismatch et provenance composite, sans Block ni continuité/replay.
|
||||||
|
|
||||||
|
## 32. Correctif `pre.003-fix.001` — helpers préparatoires sans dead code
|
||||||
|
|
||||||
|
Le gate opérateur de `pre.003` a confirmé que `cargo check --workspace` et les 45 tests Worker passaient, mais `cargo clippy --workspace --all-targets --all-features -- -D warnings` échouait sur huit warnings `dead_code` dans `runtime_resources.rs`.
|
||||||
|
|
||||||
|
Les éléments concernés étaient exclusivement les adapters privés préparatoires de `pre.003` et leur fingerprint, encore sans consommateur productif avant `pre.004` :
|
||||||
|
|
||||||
|
```text
|
||||||
|
RAW_TRANSACTION_INGEST_YELLOWSTONE_FILTER_FINGERPRINT_DOMAIN
|
||||||
|
RawTransactionIngestSourceFamily
|
||||||
|
RawTransactionIngestSourceTimestamp
|
||||||
|
RawTransactionIngestSourceSignal
|
||||||
|
RawTransactionIngestYellowstoneSignalView
|
||||||
|
matched_filter_fingerprint
|
||||||
|
project_yellowstone_signal
|
||||||
|
impls Transaction / TransactionStatus associés
|
||||||
|
```
|
||||||
|
|
||||||
|
Le correctif applique directement `RUST-API-008` : ces helpers strictement privés restent présents et couverts par les unit tests de `pre.003`, mais sont compilés sous `#[cfg(test)]` jusqu'à leur première consommation de production réelle en `pre.004`. Aucun `#[allow(dead_code)]` ni `#[expect(dead_code)]` n'est ajouté.
|
||||||
|
|
||||||
|
Le champ privé `route` de `RawTransactionIngestYellowstoneSource` reste, lui, productif : sa validation appartient déjà au contrat de construction `pre.003`. Il est désormais lu par le `Debug` sûr de la source, qui n'expose que les `RawProvenanceCode` déjà bornés et validés.
|
||||||
|
|
||||||
|
Le correctif ne change ni la surface publique, ni le graphe Cargo, ni le scope fonctionnel de `pre.003`, et n'active toujours aucun stream Yellowstone, HTTP ou Store réseau.
|
||||||
|
|||||||
Reference in New Issue
Block a user