feat(review 008 Unit 3c): the gate-2 e2e harness; 0.8.0 release bookkeeping
- src/channels/gate2_tests.rs (ADR-051 gates 6/7, review 008 gate 2): the full consumer -> hub (HubLegTemplate) -> spoke relay e2e — the open resolves with the hub-allocated channel_id, `bound` survives the relay, data flows both directions with a fake 8-byte chunk header riding verbatim (the hub never parses the data plane, ADR-034/035), spoke-side close cascades to clean reclaim on both legs; hub-side disconnect (the consumer's duplex end dropped via a killable transport proxy) tears down both legs with the ledger decremented; the mid-establishment window (ADR-051 §6) pinned with its two reclaim signals — the consumer leg reclaims at its own transport EOF, the spoke channel (allocated before the establisher replied) is the honest residual, reclaimed when the spoke-leg transport ends; the channels/tty/sub standard-shape companion pins no derivation regression. - src/channels/relay.rs: the relay's adopted producer-leg channel entry now reclaims when the relayed pump completes (teardown after pump_bidi) — the consumer-leg wrapper's teardown cannot see the producer leg's manager; the RelayPlan carries the spoke id for the reclaim. - Release bookkeeping: 0.7.1 -> 0.8.0, the CHANGELOG entry covering Units 1-3 (Establishment reply projection, open_channel_with_reply, flavor-form discovery derivation, ChannelRelay, HubLegTemplate, gate-2 harness); review 008 Status -> Resolved with the U-1/U-2 commit refs and the 955->945 errata note; ADR-051 Status -> all units landed + the §6 mid-establishment residual expanded to the two-reclaim-signal shape the gate pins; the stale "0.7.2" version mentions in ADR-047/049 corrected to 0.8.0 (the units land unreleased). Verification: cargo test 669 passed / 0 failed; clippy --all-targets -- -D warnings clean; fmt --check clean; cargo doc --no-deps clean; cargo check + clippy on wasm32-unknown-unknown clean; cargo publish --dry-run --allow-dirty passed.
This commit is contained in:
1 parent
4e52bd496c
commit
50182d7298
10 files changed
+903
-21
No files matched your search
+21
-5
@@ -62,10 +62,12 @@ pub struct ProducerLeg {
|
||||
}
|
||||
|
||||
/// The plan payload the relay's establisher hands its pump handler:
|
||||
/// the spoke-leg streams. The establisher and the handler agree on
|
||||
/// this concrete type (the `ChannelPlan` downcast contract, ADR-049
|
||||
/// amendment 2); alkcall never inspects it.
|
||||
/// the spoke-leg streams plus the adopted spoke `channel_id`. The
|
||||
/// establisher and the handler agree on this concrete type (the
|
||||
/// `ChannelPlan` downcast contract, ADR-049 amendment 2); alkcall
|
||||
/// never inspects it.
|
||||
struct RelayPlan {
|
||||
spoke_id: u32,
|
||||
spoke_send: MpscSendStream,
|
||||
spoke_recv: MpscRecvStream,
|
||||
}
|
||||
@@ -139,6 +141,7 @@ impl ChannelRelay {
|
||||
let producer_call = Arc::clone(&self.producer_leg.call);
|
||||
let producer_manager = self.producer_leg.manager.clone();
|
||||
let op_name = spec.name.clone();
|
||||
let handler_manager = producer_manager.clone();
|
||||
let establisher: OpenEstablisher = Arc::new(move |input, per_call_auth| {
|
||||
let producer_call = Arc::clone(&producer_call);
|
||||
let producer_manager = producer_manager.clone();
|
||||
@@ -156,6 +159,7 @@ impl ChannelRelay {
|
||||
});
|
||||
|
||||
let open_handler: OpenHandler = Arc::new(move |_input, plan, channel_conn, _auth| {
|
||||
let producer_manager = handler_manager.clone();
|
||||
tokio::spawn(async move {
|
||||
let Some(plan) = plan else {
|
||||
return;
|
||||
@@ -179,8 +183,19 @@ impl ChannelRelay {
|
||||
// The byte-forward hop (ADR-042 layer 2, ADR-050):
|
||||
// two pumps joined inline (R-02). On completion the
|
||||
// pump's drops EOF the spoke leg; the wrapper's
|
||||
// handler-exit teardown covers the consumer leg.
|
||||
let _ = pump_bidi(bidi, relay_plan.spoke_recv, relay_plan.spoke_send).await;
|
||||
// handler-exit teardown covers the consumer leg. The
|
||||
// adopted spoke channel entry is reclaimed here so the
|
||||
// producer-leg manager holds no stale routing state
|
||||
// after the relayed channel is done (the consumer-leg
|
||||
// wrapper's teardown cannot see it — it is on the
|
||||
// producer leg's manager).
|
||||
let RelayPlan {
|
||||
spoke_id,
|
||||
spoke_send,
|
||||
spoke_recv,
|
||||
} = relay_plan;
|
||||
let _ = pump_bidi(bidi, spoke_recv, spoke_send).await;
|
||||
let _ = producer_manager.teardown_channel(spoke_id);
|
||||
})
|
||||
});
|
||||
|
||||
@@ -252,6 +267,7 @@ async fn open_on_producer_leg(
|
||||
}
|
||||
|
||||
let establishment = Establishment::new(Arc::new(RelayPlan {
|
||||
spoke_id,
|
||||
spoke_send,
|
||||
spoke_recv,
|
||||
}) as super::operations::ChannelPlan);
|
||||
|
||||
Reference in new issue
Block a user