Skip to content

Commit

Permalink
Update docs and default rpc endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
helius-kurt committed Jul 25, 2024
1 parent b82d806 commit e4eacd2
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Validator Firewall
# Validator Firewall

Low level blocking for validator nodes. This project is a work in progress and interfaces may change.

Expand Down Expand Up @@ -63,7 +63,11 @@ cargo build
#If -p is not specified, we only act on 8009, 8010
RUST_LOG=info cargo xtask run --release -- --iface <iface> --static-overrides <path_to_static_overrides.yaml> -p 8004 -p 8005 -p 8006
```
## Leader Schedule Aware Blocking

By default, the firewall will attempt to determine the identity of the validator by looking at "getIdentity" from the given
RPC endpoint (default: http://localhost:8099). If an external RPC endpoint is specified, the identity of the validator
being protected *MUST* be provided, or the firewall will not be able to determine if the validator is the leader or not.

## Production
This should be run under a user with the CAP_NET_ADMIN capability. This is required to load the eBPF program and to set the XDP program on the interface.
Expand Down
5 changes: 5 additions & 0 deletions install_service.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ if ! command_exists cargo; then
exit 1
fi

//install rust nightly and bpf linker
echo "Installing Rust nightly and BPF linker..."
rustup toolchain install nightly --component rust-src
cargo install bpf-linker

# Build the eBPF binary
echo "Running 'cargo xtask build-ebpf --release'..."
if ! cargo xtask build-ebpf --release; then
Expand Down
6 changes: 3 additions & 3 deletions validator-firewall/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ struct HVFConfig {
iface: String,
#[clap(short, long)]
static_overrides: Option<PathBuf>,
#[clap(short, long, default_value = "https://api.mainnet-beta.solana.com")]
#[clap(short, long, default_value = "http://localhost:8899")]
rpc_endpoint: String,
#[arg(short, long, value_name = "PORT", value_parser = clap::value_parser!(u16), num_args = 0..)]
protected_ports: Vec<u16>,
Expand Down Expand Up @@ -135,7 +135,7 @@ async fn main() -> Result<(), anyhow::Error> {
let gossip_exit = exit.clone();

let ip_svc_handle = if let Some(url) = config.external_ip_service_url {
// Use external IP service
info!("Using external IP service: {}", url);
let ip_service = ExternalAllowListClient::new(url);
let state_updater = AllowListStateUpdater::new(
gossip_exit,
Expand All @@ -150,7 +150,7 @@ async fn main() -> Result<(), anyhow::Error> {

state_updater_handle
} else {
// Poll gossip directly
info!("Sourcing allowlist from gossip");
let s_updater = AllowListStateUpdater::new(
gossip_exit,
Arc::new(AllowListService::new(GossipAllowListClient::new(
Expand Down

0 comments on commit e4eacd2

Please sign in to comment.