112 lines
3.4 KiB
Markdown
112 lines
3.4 KiB
Markdown
<!-- file: deltas/0.2.8/pre.007-fix.001.md -->
|
|
<!-- version: 1 -->
|
|
|
|
# Delta `0.2.8-pre.007-fix.001` — déterminisme canaris heartbeat Tokio
|
|
|
|
## 1. Base et défaut corrigé
|
|
|
|
Base appliquée :
|
|
|
|
```text
|
|
0.2.8-pre.7
|
|
```
|
|
|
|
Le checkpoint opérateur confirme que `fmt`, audit Rust et `cargo check --workspace` sont propres. Le gate reste toutefois bloqué par :
|
|
|
|
```text
|
|
cargo clippy --workspace --all-targets
|
|
1 erreur clippy::implicit_return dans le helper test yield_runtime_steps
|
|
|
|
cargo test -p ksp-onchain-transport-lib
|
|
329/331 unit passent
|
|
2 échecs heartbeat test-only
|
|
```
|
|
|
|
Les autres canaris heartbeat, notamment policy Helius-only, absence sur standard, write failure/reconnect et réarmement après reconnexion, passent déjà. Aucun défaut runtime heartbeat n'est démontré.
|
|
|
|
## 2. Version technique
|
|
|
|
```text
|
|
workspace.package.version = 0.2.8-pre.7.fix.1
|
|
commit attendu = v0.2.8-pre.007-fix.001
|
|
Git tag = aucun tag prerelease
|
|
```
|
|
|
|
Le header root `Cargo.toml` passe en version `228`.
|
|
|
|
## 3. Correction `implicit_return`
|
|
|
|
Le helper privé test-only :
|
|
|
|
```rust
|
|
async fn yield_runtime_steps()
|
|
```
|
|
|
|
termine désormais par un `return;` explicite après sa boucle de yields. Aucun `allow` Clippy n'est introduit.
|
|
|
|
## 4. Armement déterministe du timer Tokio
|
|
|
|
Dans le canari 60 s, `tokio::time::pause()` était suivi immédiatement de `advance(59 s)`. Rien ne garantissait alors que la tâche actor ait déjà été pollée et ait enregistré son `sleep_until(heartbeat_deadline)` sous l'horloge pausée.
|
|
|
|
Le fix insère un passage de stabilisation par `yield_runtime_steps().await` immédiatement après `pause()` et avant toute avance. Le canari vérifie ensuite toujours la vraie cadence runtime :
|
|
|
|
```text
|
|
t=59 s aucun Ping
|
|
t=60 s un Ping
|
|
t=119 s aucun second Ping
|
|
t=120 s second Ping
|
|
```
|
|
|
|
Aucune cadence spéciale de test n'est créée.
|
|
|
|
## 5. Sémantique du canari close
|
|
|
|
Le canari close est renforcé en deux étapes :
|
|
|
|
```text
|
|
t=30 s avant close -> observation channel obligatoirement Empty
|
|
après close -> aucun Ping `Ok(())` accepté
|
|
```
|
|
|
|
Après réception de la frame Close, le serveur fixture termine et détruit naturellement son sender. Le receiver peut donc rendre `Disconnected`, ce qui prouve toujours qu'aucun heartbeat n'a été émis après fermeture. Exiger uniquement `Empty` après close était une hypothèse incorrecte du test.
|
|
|
|
## 6. Runtime explicitement inchangé
|
|
|
|
Ce fix ne modifie pas :
|
|
|
|
```text
|
|
crates/ksp-onchain-transport-lib/src/ws_session.rs
|
|
HELIUS_WS_HEARTBEAT_INTERVAL = 60 s
|
|
WebSocket Ping control frame
|
|
WsProtocolKind
|
|
WsSessionSettings
|
|
Config / schema / env
|
|
transactionSubscribe / transactionNotification lifecycle
|
|
reconnect / remap / backpressure
|
|
```
|
|
|
|
Il ne rajoute aucune dépendance ni feature.
|
|
|
|
## 7. Fichiers modifiés
|
|
|
|
```text
|
|
Cargo.toml
|
|
crates/ksp-onchain-transport-lib/unit_tests/ws_session.rs
|
|
docs/plans/015-V0_2_8_HELIUS_LASERSTREAM_WEBSOCKET_PLAN.md
|
|
docs/validation/011-V0_2_8_HELIUS_LASERSTREAM_WEBSOCKET.md
|
|
deltas/0.2.8/pre.007-fix.001.md
|
|
```
|
|
|
|
## 8. Gate opérateur
|
|
|
|
```bash
|
|
cargo fmt --all
|
|
python3 scripts/audit_rust_workspace_rules.py
|
|
cargo check --workspace
|
|
cargo clippy --workspace --all-targets
|
|
cargo test -p ksp-onchain-transport-lib
|
|
cargo test --workspace
|
|
```
|
|
|
|
Critère de fermeture : zéro warning, audit clean, **331 unit / 40 public API / 29 completeness / 4 doctests** et workspace vert. `pre.008` reste bloqué jusque-là.
|