agave-xdp-ebpf

Crates.ioagave-xdp-ebpf
lib.rsagave-xdp-ebpf
version3.1.7
created_at2025-10-26 04:12:23.088807+00
updated_at2026-01-19 11:04:40.601332+00
descriptionBlockchain, Rebuilt for Scale
homepagehttps://anza.xyz/
repositoryhttps://github.com/anza-xyz/agave
max_upload_size
id1900930
size15,145
(anza-team)

documentation

README

Overview

agave-xdp-ebpf is the eBPF XDP program loaded by Agave.

It's a lib AND bin package, where the bin package is used to build the eBPF bytecode, and the lib package is used to bundle the eBPF bytecode in a host crate and loaded as a regular dependency.

Usage

To use the program you can depend on the agave-xdp-ebpf crate and load the bytecode available at agave_xdp_ebpf::AGAVE_XDP_EBPF_PROGRAM using aya::Ebpf::load.

Building the eBPF XDP program

The eBPF program is prebuilt and saved in ./agave-xdp-prog. This is done so that the crate can be built from crates.io. To rebuild the program from the monorepo root run:

scripts/build-agave-xdp-ebpf.sh

The ebpf program must be rebuilt anytime the source changes (duh), or the rust nightly version used by the monorepo is bumped.

Verify the crates.io bytecode

To verify that the bytecode loaded by agave via crates.io matches the bytecode generated by the source included in this package, from the monorepo root run:

# This will rebuild and print whether the hashes have changed. If you haven't made any
# modications, the hashes must match.
scripts/build-agave-xdp.sh

# If the hashes match, build agave as usual and verify that the final code also matches
scripts/elf-hash-symbol.sh target/release/agave-validator AGAVE_XDP_EBPF_PROGRAM
Commit count: 31133

cargo fmt