Commit 46622df
committed
Modify
Replace `pending_outbound_buffer`,
`pending_outbound_buffer_first_msg_offset`, and
`gossip_broadcast_buffer` fields in `Peer` with a single `message_queue:
ChunkedMessageQueue`.
Update `should_read` to check `message_queue.pending_bytes()` against
the buffer limit. Update `should_buffer_onion_message` and
`should_buffer_gossip_broadcast` to drop the
`pending_outbound_buffer.is_empty()` check (the contiguous chunk buffer
no longer has a meaningful "queue empty" concept). Update
`buffer_full_drop_gossip_broadcast` to use
`message_queue.total_buffered_bytes()`.
Rewrite `do_attempt_write_data` to: send full chunks first, then buffer
messages (onion -> gossip broadcast -> backfill), then pad+finalize any
partial chunk with Ping padding before sending. During handshake, send
raw bytes without chunking.
Update `enqueue_message` to use `encrypt_and_push_message`. Update
handshake act handling to use `push_raw`. Update gossip broadcast sites
to use `message_queue.gossip_broadcast_buffer`.
Co-Authored-By: HAL 9000Peer to use ChunkedMessageQueue
1 parent 3306125 commit 46622df
File tree
4 files changed
+127
-118
lines changed- fuzz/src
- lightning/src/ln
4 files changed
+127
-118
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
| 50 | + | |
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| |||
201 | 201 | | |
202 | 202 | | |
203 | 203 | | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
204 | 213 | | |
205 | 214 | | |
206 | 215 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
82 | | - | |
83 | | - | |
84 | | - | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
85 | 87 | | |
86 | 88 | | |
87 | 89 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| |||
540 | 540 | | |
541 | 541 | | |
542 | 542 | | |
543 | | - | |
544 | | - | |
545 | | - | |
546 | | - | |
547 | | - | |
548 | | - | |
549 | | - | |
550 | | - | |
551 | | - | |
552 | | - | |
553 | | - | |
554 | | - | |
555 | | - | |
556 | | - | |
557 | | - | |
558 | | - | |
559 | | - | |
560 | | - | |
561 | | - | |
562 | | - | |
563 | | - | |
564 | | - | |
565 | | - | |
566 | | - | |
567 | | - | |
568 | | - | |
569 | | - | |
570 | | - | |
571 | | - | |
572 | | - | |
573 | | - | |
574 | | - | |
575 | | - | |
576 | | - | |
577 | | - | |
578 | 543 | | |
579 | 544 | | |
580 | 545 | | |
| |||
1056 | 1021 | | |
1057 | 1022 | | |
1058 | 1023 | | |
1059 | | - | |
| 1024 | + | |
| 1025 | + | |
1060 | 1026 | | |
1061 | 1027 | | |
1062 | 1028 | | |
| |||
1101 | 1067 | | |
1102 | 1068 | | |
1103 | 1069 | | |
1104 | | - | |
| 1070 | + | |
| 1071 | + | |
1105 | 1072 | | |
1106 | 1073 | | |
1107 | 1074 | | |
| |||
0 commit comments