Sure, except it happens in real-time.
There must be some kind of timeout. If I promise to pay X, then I need to reserve that portion of the trust link. If the IOU isn't cashed in, then I can purse the funding lock.
Each frame header has a length field.
Sorry must have missed it.
For this I have frame version and type fields in the frame header, and message type in the message header... I don't think I need message length, because the frames should be reliably reassembled into messages, and the messages should be signed if their content is important. Am I still missing something?
Not sure. Ideally, a proxy server should be able to skip/pass on messages/frames that it doesn't understand and just scan for the ones that it is interested in.