Commit 5cc34c0
committed
Use longer TTL for pubsub seen messages
Once a message is received and validated, pubsub re-broadcasts it
to other peers and puts it into the seen messages cache. This way,
subsequent arrivals of the same message are not re-broadcasted
unnecessarily. This mechanism is important for the network to avoid
excessive message flooding. The default value used by libp2p is 2 minutes.
However, Keep client messaging sessions are quite time-consuming so,
we use a longer TTL of 5 minutes to reduce flooding risk even further. Worth
noting that this time cannot be too long as the cache may grow excessively and
impact memory consumption.
(cherry picked from commit a712112)1 parent 6fc7b5d commit 5cc34c0
1 file changed
+12
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
20 | 31 | | |
21 | 32 | | |
22 | 33 | | |
| |||
53 | 64 | | |
54 | 65 | | |
55 | 66 | | |
| 67 | + | |
56 | 68 | | |
57 | 69 | | |
58 | 70 | | |
| |||
0 commit comments