Skip to content

Add AddressAnnouncement event to p2p-extractor - #296

Merged
0xB10C merged 2 commits into
masterfrom
2025-11-p2p-extractor-addr
Nov 21, 2025
Merged

0xB10C merged 2 commits into
masterfrom
2025-11-p2p-extractor-addr

Conversation

@0xB10C

@0xB10C 0xB10C commented Nov 20, 2025 •

Copy link
Copy Markdown
Collaborator

This event is published when the node makes an address announcement (addrv2) to the p2p-extractor. This event is useful for the following metrics:

  • size of the (last) address announcement (Grafana dashboards can show this over time)
  • total number of addresses announced per announcement, by network
  • rate of the announcements to us

As part of #263

@0xB10C

0xB10C commented Nov 20, 2025

Copy link
Copy Markdown
Collaborator Author

One metric to add here: Number of address announcements with 10 or less addresses. This allows us to calculate what share of addresses we would have forwarded.

@0xB10C
0xB10C force-pushed the 2025-11-p2p-extractor-addr branch from 5bfc4fd to 8bc6cd2 Compare November 20, 2025 18:18
@0xB10C

0xB10C commented Nov 21, 2025

Copy link
Copy Markdown
Collaborator Author

Should also check on test coverage before merging this!

Comment thread extractors/p2p/tests/integration.rs Resolved
@0xB10C
0xB10C force-pushed the 2025-11-p2p-extractor-addr branch 2 times, most recently from b49dbac to 9d625fe Compare November 21, 2025 13:11
The p2p-extractor publishes received addrv2 messages as
AddressAnnoucement events. This allows to monitor the nodes
address relay behavoir.

As part of #263
@0xB10C
0xB10C force-pushed the 2025-11-p2p-extractor-addr branch from 9d625fe to d576e7d Compare November 21, 2025 13:13
@0xB10C

0xB10C commented Nov 21, 2025

Copy link
Copy Markdown
Collaborator Author

Should also check on test coverage before merging this!

|| Tested/Total Lines:
|| extractors/ebpf/src/error.rs: 0/34 +0.00%
|| extractors/ebpf/src/main.rs: 0/331 +0.00%
|| extractors/ebpf/src/tracing.gen.rs: 0/371 +0.00%
|| extractors/log/src/error.rs: 0/16 +0.00%
|| extractors/log/src/lib.rs: 30/38 +0.00%
|| extractors/log/src/main.rs: 0/7 +0.00%
|| extractors/log/tests/integration.rs: 55/57 +0.00%
|| extractors/p2p/src/error.rs: 7/31 +0.00%
|| extractors/p2p/src/lib.rs: 95/123 +0.60%
|| extractors/p2p/src/main.rs: 0/7 +0.00%
|| extractors/p2p/tests/integration.rs: 105/109 +0.25%
|| extractors/rpc/src/error.rs: 0/36 +0.00%
|| extractors/rpc/src/lib.rs: 34/37 +0.00%
|| extractors/rpc/src/main.rs: 0/7 +0.00%
|| extractors/rpc/tests/integration.rs: 45/47 +0.00%
|| shared/src/log_matchers.rs: 37/37 +0.00%
|| shared/src/metricserver.rs: 25/46 +0.00%
|| shared/src/nats_subjects.rs: 10/10 +0.00%
|| shared/src/protobuf/addrman.rs: 8/23 +0.00%
|| shared/src/protobuf/ctypes.rs: 27/147 +0.00%
|| shared/src/protobuf/event_msg.rs: 7/7 +0.00%
|| shared/src/protobuf/log_extractor.rs: 8/8 +0.00%
|| shared/src/protobuf/mempool.rs: 6/45 +0.00%
|| shared/src/protobuf/net_conn.rs: 7/41 +0.00%
|| shared/src/protobuf/net_msg.rs: 14/298 +0.00%
|| shared/src/protobuf/p2p_extractor.rs: 13/16 -18.75%
|| shared/src/protobuf/primitive.rs: 33/137 +12.37%
|| shared/src/protobuf/rpc.rs: 60/63 +0.00%
|| shared/src/protobuf/validation.rs: 6/13 +0.00%
|| shared/src/testing/nats_publisher.rs: 8/8 +0.00%
|| shared/src/testing/nats_server.rs: 44/57 -8.77%
|| shared/src/util.rs: 21/22 +0.00%
|| tools/connectivity-check/src/main.rs: 0/189 +0.00%
|| tools/connectivity-check/src/metrics.rs: 0/16 +0.00%
|| tools/logger/src/error.rs: 2/20 +0.00%
|| tools/logger/src/lib.rs: 48/56 +1.79%
|| tools/logger/src/main.rs: 0/7 +0.00%
|| tools/logger/tests/integration.rs: 45/48 +0.00%
|| tools/metrics/src/error.rs: 5/24 +0.00%
|| tools/metrics/src/lib.rs: 422/425 -0.22%
|| tools/metrics/src/main.rs: 0/7 +0.00%
|| tools/metrics/src/metrics.rs: 11/11 +0.00%
|| tools/metrics/src/stat_util.rs: 14/14 +0.00%
|| tools/metrics/tests/integration.rs: 66/77 +0.00%
|| tools/websocket/src/error.rs: 0/24 +0.00%
|| tools/websocket/src/lib.rs: 39/45 +0.00%
|| tools/websocket/src/main.rs: 0/7 +0.00%
|| tools/websocket/tests/integration.rs: 54/63 +0.00%
|| 
43.26% coverage, 1411/3262 lines covered, +1.89% change in coverage

@0xB10C

0xB10C commented Nov 21, 2025

Copy link
Copy Markdown
Collaborator Author
warning: unused variable: `mocktime`
   --> extractors/p2p/tests/integration.rs:148:13
    |
148 |     let mut mocktime = util::current_timestamp();
    |             ^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_mocktime`
    |
    = note: `#[warn(unused_variables)]` on by default

warning: variable does not need to be mutable
   --> extractors/p2p/tests/integration.rs:148:9
    |
148 |     let mut mocktime = util::current_timestamp();
    |         ----^^^^^^^^
    |         |
    |         help: remove this `mut`
    |
    = note: `#[warn(unused_mut)]` on by default

0xB10C added a commit that referenced this pull request Nov 22, 2025
0xB10C added a commit that referenced this pull request Nov 24, 2025
forge-dev480lo added a commit to forge-dev480lo/peer-observer that referenced this pull request Dec 13, 2025
@0xB10C
0xB10C deleted the 2025-11-p2p-extractor-addr branch January 6, 2026 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant