Thanks to visit codestin.com
Credit goes to github.com

Skip to content

where Ethereum listens to itself // a collection of probes and instruments to observe the p2p layer

Notifications You must be signed in to change notification settings

ethp2p/afferent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Afferent

If you breathe like a client and act like a client, then you're probably a client.

banner.png

Afferent is a p2p instrumentation framework for analyzing live networking activity within Ethereum's consensus layer. Afferent works by embedding a fully functional Ethereum consensus client (Prysm), and weaving in instrumentation in strategic places to capture precise datapoints in minimally invasive ways. Probes leverage Prysm's machinery to offer external behaviour that's identical to any other Ethereum client. Compared to building standalone tools, this approach yields more realistic and representative measurements, enables reliable continuous long-lived captures, and reduces the effort required to develop robust tools.

Why "Afferent"? Afferent authors are fascinated by biology and neuroscience. Afferent neurons carry sensory information from peripheral parts of the body towards the central nervous system (in a centripetal direction). They are also responsible for our sense of _interoception_: they monitor the internal state of the body by watching vitals like heart rate, blood pressure, gas levels, glucose levels, etc. This information travels along the vagus nerve and various sympathetic and parasympathetic pathways, where it is partially processed before it reaches the CNS for full integration and reaction.

Features

  • Basic gossipsub Tracing: JSON-based event tracing for libp2p pubsub interactions, capturing detailed protocol behavior and message flow.
  • 🚧 Enhanced gossipsub analysis: Capture local mesh snapshots, peer scoring dynamics, and structured events for improved analysis.
  • 🚧 Granular network I/O attribution: Categorize traffic by protocol context and purpose, distinguishing activity by topic and action type.
  • 🚧 Wire-level propagation metrics: Measure attestation, block, and blob propagation in real-time, capturing latency and network bottlenecks.
  • 🚧 Multi-head gossipsub: Spawn multiple network identities to build evolving models of network topology and characteristics.
  • 🚧 DAS guardian integration: Monitor node compliance with data availability custody requirements.
  • 🚧 Continuous crawler: Run sophisticated analysis including underlay metrics and status response recording.

Project Structure

afferent/
├── cmd/afferent/           # Main application entrypoint
├── probes/                 # Modular instrumentation components
│   └── gossipsub/          # Gossipsub instrumentation
├── ext/                    # External dependencies (git submodules)
│   ├── go-libp2p/          # Core p2p networking library
│   ├── go-libp2p-pubsub/   # Pubsub protocol implementation
│   └── prysm/              # Prysm (Ethereum consensus client)
│       └── x/              # Prysm extensions for instrumentation 
└── out/                    # Build artifacts and trace outputs

Contributing

Afferent maintains a minimally-invasive approach to instrumentation. When adding new capabilities:

  1. Implement probes as modular components in the probes/ directory.
  2. Use interceptor patterns to inject instrumentation.
  3. Minimize modifications to upstream dependencies.
  4. Document output formats and analysis methods.

Acknowledgments

Built on top of Prysm and libp2p.

About

where Ethereum listens to itself // a collection of probes and instruments to observe the p2p layer

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published