Commit fc20a34
authored
feat: add gossipsub message payload event for raw wire-bytes capture (#877)
* feat: add gossipsub message payload event for raw wire-bytes capture
Adds LIBP2P_TRACE_GOSSIPSUB_MESSAGE_PAYLOAD end-to-end: proto event and
payload messages, clmimicry handler (opt-in via
gossipSubMessagePayloadEnabled, off by default), event-ingester
registration, ClickHouse table libp2p_gossipsub_message_payload, and the
consumoor route.
The table's sorting key and distributed sharding key are content-derived
(message IDs are content hashes), so identical messages captured by
multiple vantage points deduplicate on merge. Payload bytes are stored
exactly as received off the wire, so capture works for any topic without
a decoder, including validation-rejected messages.
Claude-Session: https://claude.ai/code/session_01KDvdo7uVQpxKWgk2gLnWpE
* refactor: append validated payload route fields unconditionally
validate() already rejects events missing the wallclock fields or message
ID, so the sentinel-zero fallback branches were unreachable and read as if
missing data could silently insert epoch-zero timestamps.
Claude-Session: https://claude.ai/code/session_01KDvdo7uVQpxKWgk2gLnWpE
* refactor: drop observation-scoped columns from payload table
The table deduplicates by content-derived message ID across capture
clients, so per-observation columns were nondeterministic: whichever row
survived the merge won. peer_id_unique_key and reject_reason are dropped
(peer attribution and reject reasons live in libp2p_deliver_message and
libp2p_reject_message), and outcome moves into the sorting key so a
message delivered by one client and rejected by another keeps one row per
outcome instead of racing.
Claude-Session: https://claude.ai/code/session_01KDvdo7uVQpxKWgk2gLnWpE
* refactor: drop outcome column from payload table
The table stores message content keyed by content-derived message ID;
validation outcome is a fact about an observation, not the bytes, and
lives per-vantage in libp2p_deliver_message and libp2p_reject_message.
This also collapses fork-contested messages (delivered by some clients,
rejected by others) to a single row. The proto event keeps outcome and
reject_reason for stream consumers.
Claude-Session: https://claude.ai/code/session_01KDvdo7uVQpxKWgk2gLnWpE
* fix: accept empty message data in payload handler
A nil Data slice is a legitimate zero-byte message, and rejecting it
meant exactly that class of message was never archived. Also documents
that dedup is best-effort for messages received across wallclock slot or
partition boundaries.
Claude-Session: https://claude.ai/code/session_01KDvdo7uVQpxKWgk2gLnWpE1 parent a83a609 commit fc20a34
22 files changed
Lines changed: 6161 additions & 4212 deletions
File tree
- deploy/migrations/clickhouse/xatu
- pkg
- clickhouse/route/libp2p
- clmimicry
- proto
- libp2p/gossipsub
- xatu
- server/service/event-ingester/event
- libp2p
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
Lines changed: 39 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
| 133 | + | |
133 | 134 | | |
134 | 135 | | |
135 | 136 | | |
| |||
Lines changed: 216 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 130 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
0 commit comments