v0.3.14-pre.007-fix.001
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
# file: Cargo.toml
|
||||
# version: 574
|
||||
# version: 575
|
||||
|
||||
[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.14-pre.7"
|
||||
version = "0.3.14-pre.7.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: 33
|
||||
// version: 34
|
||||
|
||||
use sha2::Digest; // rust-rules: trait-import
|
||||
|
||||
@@ -4033,7 +4033,7 @@ enum RawTransactionIngestKnownReferenceMissingDisposition {
|
||||
}
|
||||
|
||||
enum RawTransactionIngestKnownReferenceHydrationResolution {
|
||||
Available(crate::RawTransactionIngress),
|
||||
Available(std::boxed::Box<crate::RawTransactionIngress>),
|
||||
Missing {
|
||||
disposition: RawTransactionIngestKnownReferenceMissingDisposition,
|
||||
obligation: crate::RawTransactionIngestKnownReferenceObligation,
|
||||
@@ -4239,7 +4239,7 @@ impl RawTransactionIngestHydrationCoordinator {
|
||||
std::result::Result::Err(error) => return std::result::Result::Err(error),
|
||||
};
|
||||
let ingress = match resolution {
|
||||
RawTransactionIngestKnownReferenceHydrationResolution::Available(value) => value,
|
||||
RawTransactionIngestKnownReferenceHydrationResolution::Available(value) => *value,
|
||||
RawTransactionIngestKnownReferenceHydrationResolution::Missing { disposition, obligation } => {
|
||||
if obligation.commitment() != hydration.commitment
|
||||
|| obligation.reference().network() != &hydration.network
|
||||
@@ -4431,7 +4431,7 @@ fn resolve_known_reference_hydration(
|
||||
std::result::Result::Err(error) => return std::result::Result::Err(error),
|
||||
};
|
||||
if let std::option::Option::Some(value) = ingress {
|
||||
return std::result::Result::Ok(RawTransactionIngestKnownReferenceHydrationResolution::Available(value));
|
||||
return std::result::Result::Ok(RawTransactionIngestKnownReferenceHydrationResolution::Available(std::boxed::Box::new(value)));
|
||||
}
|
||||
let block_slot_supported = match http_role_supports_rpc_method(&hydration.http_pool, &hydration.hydration_role, "getBlock", hydration.network.as_str()) {
|
||||
std::result::Result::Ok(value) => value,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// file: crates/ksp-worker-raw-transaction-ingest-lib/unit_tests/runtime_resources.rs
|
||||
// version: 27
|
||||
// version: 28
|
||||
|
||||
fn grpc_endpoint(cluster: &str) -> std::option::Option<ksp_onchain_transport_lib::YellowstoneGrpcEndpointSettings> {
|
||||
return grpc_endpoint_with_identity(cluster, "yellowstone-fixture", "fixture-provider");
|
||||
@@ -3238,7 +3238,7 @@ async fn v0_3_14_pre_007_known_reference_hydration_reuses_global_registry_and_av
|
||||
_ => return,
|
||||
};
|
||||
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);
|
||||
|
||||
172
deltas/0.3.14/pre.007-fix.001.md
Normal file
172
deltas/0.3.14/pre.007-fix.001.md
Normal file
@@ -0,0 +1,172 @@
|
||||
<!-- file: deltas/0.3.14/pre.007-fix.001.md -->
|
||||
<!-- version: 1 -->
|
||||
|
||||
# Delta `0.3.14-pre.007-fix.001` — correction `large_enum_variant`
|
||||
|
||||
## Base requise
|
||||
|
||||
```text
|
||||
0.3.14-pre.007
|
||||
workspace.package.version = 0.3.14-pre.7
|
||||
deltas/0.3.14/pre.007.md présent
|
||||
```
|
||||
|
||||
## Objectif
|
||||
|
||||
Corriger strictement la tranche `pre.007` après le gate opérateur, sans modifier sa responsabilité fonctionnelle :
|
||||
|
||||
```text
|
||||
faire passer Clippy -D warnings sans allow/expect
|
||||
conserver exactement la distinction Available/Missing de l'hydration known-reference
|
||||
conserver le registre global d'hydration unique
|
||||
ne pas avancer la réconciliation prévue en pre.008
|
||||
```
|
||||
|
||||
## Défaut observé
|
||||
|
||||
Le gate opérateur sur `0.3.14-pre.7` a produit :
|
||||
|
||||
```text
|
||||
cargo fmt --all : PASS
|
||||
cargo fmt --all -- --check : PASS
|
||||
audit Rust workspace rules : PASS
|
||||
audit Markdown tables : PASS
|
||||
cargo check --workspace : PASS
|
||||
cargo clippy --workspace --all-targets --all-features -- -D warnings : FAIL
|
||||
cargo test -p ksp-worker-raw-transaction-ingest-lib --all-targets --all-features : PASS
|
||||
```
|
||||
|
||||
Clippy refuse `RawTransactionIngestKnownReferenceHydrationResolution` avec `clippy::large_enum_variant` :
|
||||
|
||||
```text
|
||||
Available(RawTransactionIngress) : au moins 488 octets
|
||||
Missing { ... } : au moins 105 octets
|
||||
```
|
||||
|
||||
Les `133` unit tests Worker ainsi que les suites d'intégration exécutées passent ; le défaut est donc un défaut de représentation mémoire détecté par le gate strict, pas un échec fonctionnel observé.
|
||||
|
||||
## Cause
|
||||
|
||||
`pre.007` transporte directement `RawTransactionIngress` dans la variante `Available` de l'enum privé de résolution known-reference.
|
||||
|
||||
`RawTransactionIngress` est nettement plus volumineux que la variante `Missing`, ce qui force chaque valeur de l'enum à avoir la taille de la variante la plus grande et déclenche le lint `large_enum_variant` sous `-D warnings`.
|
||||
|
||||
## Correction
|
||||
|
||||
La variante disponible devient :
|
||||
|
||||
```text
|
||||
Available(Box<RawTransactionIngress>)
|
||||
```
|
||||
|
||||
La valeur est boxée uniquement au moment où `finalize_hydration` fournit un ingress disponible, puis immédiatement déboxée au point de consommation avant admission dans le pipeline commun.
|
||||
|
||||
Le unit test `pre.007` qui injecte directement cette résolution dans `RawTransactionAdmission` déboxe également la valeur.
|
||||
|
||||
Aucune variante, disposition, obligation, clé de coalescence, requête HTTP, provenance ou décision de runtime ne change.
|
||||
|
||||
## Fichiers ajoutés
|
||||
|
||||
```text
|
||||
deltas/0.3.14/pre.007-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
|
||||
```
|
||||
|
||||
## Fichiers supprimés
|
||||
|
||||
```text
|
||||
aucun
|
||||
```
|
||||
|
||||
## Version Cargo
|
||||
|
||||
Le fix modifie du code Rust ; conformément à `VER-ID-007` et `VER-ID-010` :
|
||||
|
||||
```text
|
||||
header Cargo.toml : 574 -> 575
|
||||
workspace.package.version : 0.3.14-pre.7 -> 0.3.14-pre.7.fix.1
|
||||
```
|
||||
|
||||
Versions de fichiers :
|
||||
|
||||
```text
|
||||
src/runtime_resources.rs : 33 -> 34
|
||||
unit_tests/runtime_resources.rs : 27 -> 28
|
||||
```
|
||||
|
||||
## Frontières préservées
|
||||
|
||||
```text
|
||||
aucune nouvelle tâche
|
||||
aucun nouveau scheduler
|
||||
aucun nouveau registre d'hydration
|
||||
aucun nouveau retry Worker
|
||||
aucune nouvelle requête HTTP
|
||||
aucune nouvelle dépendance
|
||||
aucune nouvelle feature
|
||||
aucun accès Config depuis Worker
|
||||
aucun accès Job Backfill depuis Worker
|
||||
aucun backend Store physique depuis Worker
|
||||
aucune extension de surface publique
|
||||
aucune intégration anticipée du gap ledger/supervisor de pre.008
|
||||
```
|
||||
|
||||
## Validations exécutées
|
||||
|
||||
Dans le sandbox de préparation :
|
||||
|
||||
```text
|
||||
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
|
||||
scan des usages de RawTransactionIngestKnownReferenceHydrationResolution
|
||||
comparaison exacte pre.007 -> pre.007-fix.001
|
||||
contrôle du contenu de l'archive delta
|
||||
unzip -t de l'archive delta
|
||||
```
|
||||
|
||||
## Validations non exécutées
|
||||
|
||||
Le sandbox de préparation ne fournit pas le toolchain Cargo/Rust. Les gates suivants restent à exécuter côté opérateur :
|
||||
|
||||
```text
|
||||
cargo fmt --all
|
||||
cargo fmt --all -- --check
|
||||
cargo check --workspace
|
||||
cargo clippy --workspace --all-targets --all-features -- -D warnings
|
||||
cargo test -p ksp-worker-raw-transaction-ingest-lib --all-targets --all-features
|
||||
```
|
||||
|
||||
## Décisions prises
|
||||
|
||||
```text
|
||||
fix strict de pre.007
|
||||
indirection uniquement sur la grosse variante Available
|
||||
aucun allow/expect Clippy
|
||||
aucune modification fonctionnelle de l'hydration known-reference
|
||||
pre.008 reste la première tranche autorisée à intégrer la réconciliation au supervisor/gap ledger
|
||||
```
|
||||
|
||||
## Questions ouvertes
|
||||
|
||||
```text
|
||||
aucune pour ce fix
|
||||
```
|
||||
|
||||
## Gate opérateur après application
|
||||
|
||||
```bash
|
||||
cargo fmt --all
|
||||
cargo fmt --all -- --check
|
||||
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 --all-targets --all-features
|
||||
```
|
||||
Reference in New Issue
Block a user