Vat.Embargo is used to remove a capability from the vat. Callers should be able to know exactly when this operation succeeds, so that they can reason about access revocation. Unfortunately, libp2p's Host.RemoveStreamHandler is asynchronous, so it is often the case that Embargo returns before the stream handler is actually disabled.
Two approaches to investigate:
- Is there a signal on
event.Bus that we can wait for?
- Is there a
network.Notifiee hook that we can tap into?