pub fn splice(shared: Vec<PlanOp>, private: OverlayOps) -> Vec<PlanOp>Expand description
Insert the overlay’s operations inside the shared phases.
The overlay does not append. The counter-example is immediate: suppose the
shared delta removes channel C, and the overlay had placed the admin in it.
With the private operations last, RemoveChannel(C) goes out before the
admin is withdrawn, and an occupied channel is deleted.
So the insertion point is the boundary between the shared additions (P1 to P5) and the shared removals (P6, P7):
P1..P5 shared additions, filtered
├─ overlay removals <- before: they vacate a channel about to die
└─ overlay additions <- after: they may target a brand new channel
P6..P7 shared removals, filtered