Skip to content

feat: extended summary with per-node metadata for CipherScan ingester - #267

Closed
Kenbak wants to merge 5 commits into
runziggurat:mainfrom
atmospherelabs-dev:cipherscan/extended-summary
Closed

Kenbak wants to merge 5 commits into
runziggurat:mainfrom
atmospherelabs-dev:cipherscan/extended-summary

Conversation

@Kenbak

@Kenbak Kenbak commented Aug 27, 2026

Copy link
Copy Markdown
  • Add NodeInfo struct exposing start_height, services, handshake_time_ms per node
  • Add ExtendedSummary wrapping NetworkSummary with node_info vec
  • Update RPC context to serve extended summary via getmetrics
  • Fix network type recognition: support Zakura, update MagicBean/Zebra regex for multi-digit versions, remove incorrect Flux exclusion for MagicBean>=6

- Add NodeInfo struct exposing start_height, services, handshake_time_ms per node
- Add ExtendedSummary wrapping NetworkSummary with node_info vec
- Update RPC context to serve extended summary via getmetrics
- Fix network type recognition: support Zakura, update MagicBean/Zebra regex
  for multi-digit versions, remove incorrect Flux exclusion for MagicBean>=6
@aphelionz

Copy link
Copy Markdown
Member

@Kenbak This is great. Please fix the immediate CI issues and when copilot lands consider its feedback.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an extended metrics payload for the crawler RPC so downstream consumers (CipherScan ingester) can access both the existing NetworkSummary and per-node metadata, and updates network-type recognition heuristics for current mainnet user agents.

Changes:

  • Introduces NodeInfo and ExtendedSummary (flattening NetworkSummary plus per-node metadata) and updates the metrics snapshot to produce this extended summary.
  • Updates the RPC context and getmetrics RPC method to serve ExtendedSummary.
  • Adjusts network implementation recognition (MagicBean/Zebra regex changes and Zakura recognition).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
src/tools/crawler/rpc.rs Switches RPC context storage and getmetrics response type from NetworkSummary to ExtendedSummary.
src/tools/crawler/metrics.rs Adds NodeInfo/ExtendedSummary, populates per-node metadata, and updates network-type recognition regexes/logic.
src/tools/crawler/main.rs Updates the in-memory summary snapshot type and logging/file-output to use the wrapped NetworkSummary inside ExtendedSummary.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/tools/crawler/metrics.rs Outdated
Comment on lines +55 to +58
pub fn request_summary(&mut self, crawler: &Crawler) -> ExtendedSummary {
let summary = new_network_summary(crawler, &self.graph);
let nodes = crawler.known_network.nodes();

Comment thread src/tools/crawler/metrics.rs Outdated
Comment on lines +86 to +88
let zcash_regex = Regex::new(r"^/MagicBean:(\d+)\.(\d+)\.(\d+)/$").unwrap();
let zebra_regex = Regex::new(r"^/Zebra:(\d+)\.(\d+)\.(\d+)").unwrap();
let zakura_regex = Regex::new(r"^/Zakura:(\d+)\.(\d+)\.(\d+)").unwrap();
Kenbak and others added 4 commits August 30, 2026 08:31
- Run cargo fmt to fix CI formatting failure
- MagicBean regex now allows optional suffixes before the trailing slash
  so user agents like /MagicBean:5.1.0-rc1/ and /MagicBean:6.0.0(bitcore)/
  are correctly classified as zcashd instead of Unknown
- Refactor request_summary to clone the known-nodes map once and pass
  the snapshot into new_network_summary, avoiding redundant allocation
Wrap node.connect() in a 5s tokio timeout so dead/firewalled peers
release sockets promptly instead of hanging for ~120s on SYN retries.
Without this, 500 connection attempts every 20s accumulates half-open
FDs past MAX_CONCURRENT_CONNECTIONS until system-wide exhaustion.

Also adds all_node_addrs/all_nodes_indices/all_node_reachable to
ExtendedSummary for full known-network graph (reachable + unreachable).

Root cause fix for the 2026-09-02 mainnet outage.
Recover crawler connections and publish verified observations
@Kenbak Kenbak closed this Sep 28, 2026
@Kenbak
Kenbak deleted the cipherscan/extended-summary branch September 28, 2026 21:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants