Skip to content

Set multicast TTL on UDP sockets for shred broadcast and retransmit - #1218

Open
armcconnell wants to merge 19 commits into
jito-foundation:masterfrom
armcconnell:multicast-ttl
Open

Set multicast TTL on UDP sockets for shred broadcast and retransmit#1218
armcconnell wants to merge 19 commits into
jito-foundation:masterfrom
armcconnell:multicast-ttl

Conversation

@armcconnell

Copy link
Copy Markdown

Problem

The kernel defaults the IP TTL on multicast sockets to 1 which prevents multicast packets from being routed beyond the first hop router. For routed multicast the TTL should be increased.

Summary of Changes

Hardcode a multicast TTL of 64 and set it on UDP sockets.

Proof of testing

Unit tests

andrew@host:~/jito-solana$ cargo test --package solana-turbine test_multicast_ttl -- --nocapture
   Compiling solana-turbine v4.0.0-alpha.0 (/home/andrew/jito-solana/turbine)
    Finished `test` profile [unoptimized + debuginfo] target(s) in 9.07s
     Running unittests src/lib.rs (target/debug/deps/solana_turbine-205ae9db9d2946b5)

running 2 tests
test retransmit_stage::tests::test_multicast_ttl_set_on_retransmit_sockets ... ok
test broadcast_stage::test::test_multicast_ttl_set_on_broadcast_sockets ... ok

test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 33 filtered out; finished in 0.00s

Compiled from HEAD

sol@ams-tn-bm1:~$ /tmp/agave-validator --version
agave-validator 4.0.0 (src:8ba448e0; feat:1718981463, client:JitoLabs)

Running in a private test cluster

sol@host:~$ ps auxw | grep agave
sol      51182  759  1.1 10286860 3098000 pts/2 Sl+ 17:28  13:21 /tmp/agave-validator --identity /home/sol/validator-keypair.json --vote-account /home/sol/vote-account-keypair.json --accounts /home/sol/accounts --ledger /home/sol/ledger --allow-private-addr --block-production-method central-scheduler --dynamic-port-range 8002-8027 --entrypoint 67.213.120.9:8001 --expected-genesis-hash C97Q7ygjHJZU8AonPcgjYiBHhkfFXPVmTEH4bEwzTcX2 --tip-payment-program-pubkey GJHtFqM9agxPmkeKjHny6qiRKrXZALvvFGiKf11QE7hy --tip-distribution-program-pubkey DzvGET57TAgEDxvm3ERUM4GNcsAJdqjDLCne9sdfY4wf --merkle-root-upload-authority 7T4inmPmtNBX3MhLwJ9hFsSMnGJYYkKioVABSNTWVRuS --commission-bps 800 --block-engine-url https://127.0.0.1/jito --shred-receiver-address 127.0.0.1:1002 --shred-receiver-address 233.84.178.8:1002 --full-rpc-api --full-snapshot-interval-slots 1000 --gossip-port 8001 --known-validator 2yCbbFnG1z8iJotPb1YsjG6gUKGgu3UW5oeqDXC32wUq --known-validator 5njVpT6ek2Dgf2GLApAfJFiSnREDvrTafvokECByURUN --known-validator 7gBgs3dgyGSiNyp2wMNr5JbK1nFFGAV1z6bzQGezJ44r --limit-ledger-size 50000000 --no-wait-for-vote-to-start-leader --rpc-bind-address 0.0.0.0 --rpc-faucet-address 67.213.120.9:8899 --rpc-port 8899 --use-snapshot-archives-at-startup when-newest --wal-recovery-mode skip_any_corrupted_record

Confirm TTL is now 64.

sol@host:~$ sudo tcpdump -c5 -vvv -ni doublezero1 port 1002
tcpdump: listening on doublezero1, link-type LINUX_SLL (Linux cooked v1), snapshot length 262144 bytes
17:30:10.803025 IP (tos 0x0, ttl 64, id 63863, offset 0, flags [DF], proto UDP (17), length 1231)
    148.51.120.3.8015 > 233.84.178.8.1002: [bad udp cksum 0xac60 -> 0x1594!] UDP, length 1203
17:30:10.803043 IP (tos 0x0, ttl 64, id 63864, offset 0, flags [DF], proto UDP (17), length 1231)
    148.51.120.3.8015 > 233.84.178.8.1002: [bad udp cksum 0xac60 -> 0xc066!] UDP, length 1203
17:30:10.803052 IP (tos 0x0, ttl 64, id 63865, offset 0, flags [DF], proto UDP (17), length 1231)
    148.51.120.3.8015 > 233.84.178.8.1002: [bad udp cksum 0xac60 -> 0xbc5a!] UDP, length 1203
17:30:10.803060 IP (tos 0x0, ttl 64, id 63866, offset 0, flags [DF], proto UDP (17), length 1231)
    148.51.120.3.8015 > 233.84.178.8.1002: [bad udp cksum 0xac60 -> 0x613d!] UDP, length 1203
17:30:10.803068 IP (tos 0x0, ttl 64, id 63867, offset 0, flags [DF], proto UDP (17), length 1231)
    148.51.120.3.8015 > 233.84.178.8.1002: [bad udp cksum 0xac60 -> 0x0604!] UDP, length 1203
5 packets captured
246 packets received by filter
0 packets dropped by kernel

buffalu and others added 19 commits December 3, 2025 17:16
only reroute if relayer connected (jito-foundation#123)
feat: add client tls config (jito-foundation#121)
remove extra val (jito-foundation#129)
fix clippy (jito-foundation#130)
copy all binaries to docker-output (jito-foundation#131)
Ledger tool halts at slot passed to create-snapshot (jito-foundation#118)
update program submodule (jito-foundation#133)
quick fix for tips and clearing old bundles (jito-foundation#135)
update submodule to new program (jito-foundation#136)
Improve stake-meta-generator usability (jito-foundation#134)
pinning submodule head (jito-foundation#140)
Use BundleAccountLocker when handling tip txs (jito-foundation#147)
Add metrics for relayer + block engine proxy (jito-foundation#149)
Build claim-mev in docker (jito-foundation#141)
Rework bundle receiving and add metrics (jito-foundation#152) (jito-foundation#154)
update submodule + dev files (jito-foundation#158)
Deterministically find tip amounts, add meta to stake info, and cleanup pubkey/strings in MEV tips (jito-foundation#159)
update jito-programs submodule (jito-foundation#160)
Separate MEV tip related workflow (jito-foundation#161)
Add block builder fee protos (jito-foundation#162)
fix jito programs (jito-foundation#163)
update submodule so autosnapshot exits out of ledger tool early (jito-foundation#164)
Pipe through block builder fee (jito-foundation#167)
pull in new snapshot code (jito-foundation#171)
block builder bug (jito-foundation#172)

Pull in new slack autosnapshot submodule (jito-foundation#174)

sort stake meta json and use int math (jito-foundation#176)

add accountsdb conn submod (jito-foundation#169)

Update tip distribution parameters (jito-foundation#177)

new submodules (jito-foundation#180)

Add buildkite link for jito CI (jito-foundation#183)

Fixed broken links to repositories (jito-foundation#184)

Changed from ssh to https transfer for clone

Seg/update submods (jito-foundation#187)

fix tests (jito-foundation#190)

rm geyser submod (jito-foundation#192)

rm dangling geyser references (jito-foundation#193)

fix syntax err (jito-foundation#195)

use deterministic req ids in batch calls (jito-foundation#199)

update jito-programs

revert cargo

update Cargo lock

update with path fix

fix cargo

update autosnapshot with block lookback (jito-foundation#201)

[JIT-460] When claiming mev tips, skip accounts that won't have min rent exempt amount after claiming (jito-foundation#203)

Add logging for sol balance desired (jito-foundation#205)

* add logging

* add logging

* update msg

* tweak vars

update submodule (jito-foundation#204)

use efficient data structures when calling batch_simulate_bundles (jito-foundation#206)

[JIT-504] Add low balance check in uploading merkle roots (jito-foundation#209)

add config to simulate on top of working bank (jito-foundation#211)

rm frozen bank check

simulate_bundle rpc bugfixes (jito-foundation#214)

rm frozen bank check in simulate_bundle rpc method

[JIT-519] Store ClaimStatus address in merkle-root-json (jito-foundation#210)

* add files

* switch to include bump

update submodule (jito-foundation#217)

add amount filter (jito-foundation#218)

update autosnapshot (jito-foundation#222)

Print TX error in Bundles (jito-foundation#223)

add new args to support single relayer and block-engine endpoints (jito-foundation#224)

point to new jito-programs submod and invoke updated init tda instruction (jito-foundation#228)

fix clippy errors (jito-foundation#230)

fix validator start scripts (jito-foundation#232)

Point README to gitbook (jito-foundation#237)

use packaged cargo bin to build (jito-foundation#239)

Add validator identity pubkey to StakeMeta (jito-foundation#226)

The vote account associated with a validator is not a permanent link, so log the validator identity as well.

bugfix: conditionally compile with debug flags (jito-foundation#240)

Seg/tip distributor master (jito-foundation#242)

* validate tree nodes

* fix unit tests

* pr feedback

* bump jito-programs submod

Simplify bootstrapping (jito-foundation#241)

* startup without precompile

* update spacing

* use release mode

* spacing

fix validation

rm validation skip

Account for block builder fee when generating excess tip balance (jito-foundation#247)

Improve docker caching

delay constructing claim mev txs (jito-foundation#253)

fix stake meta tests from bb fee (jito-foundation#254)

fix tests

Buffer bundles that exceed cost model (jito-foundation#225)

* buffer bundles that exceed cost model

clear qos failed bundles buffer if not leader soon (jito-foundation#260)

update Cargo.lock to correct solana versions in jito-programs submodule (jito-foundation#265)

fix simulate_bundle client and better error handling (jito-foundation#267)

update submod (jito-foundation#272)

Preallocate Bundle Cost (jito-foundation#238)

fix Dockerfile (jito-foundation#278)

Fix Tests (jito-foundation#279)

Fix Tests (jito-foundation#281)

* fix tests

update jito-programs submod (jito-foundation#282)

add reclaim rent workflow (jito-foundation#283)

update jito-programs submod

fix clippy errs

rm wrong assertion and swap out file write fn call (jito-foundation#292)

Remove security.md (jito-foundation#293)

demote frequent relayer_stage-stream_error to warn (jito-foundation#275)

account for case where TDA exists but not allocated (jito-foundation#295)

implement better retries for tip-distributor workflows (jito-foundation#297)

limit number of concurrent rpc calls (jito-foundation#298)

Discard Empty Packet Batches (jito-foundation#299)

Identity Hotswap (jito-foundation#290)

small fixes (jito-foundation#305)

Set backend config from admin rpc (jito-foundation#304)

Admin Shred Receiver Change (jito-foundation#306)

Seg/rm bundle UUID (jito-foundation#309)

Fix github workflow to recursively clone (jito-foundation#327)

Add recursive checkout for downstream-project-spl.yaml (jito-foundation#341)

Use cluster info functions for tpu (jito-foundation#345)

Use git rev-parse for git sha

Remove blacklisted tx from message_hash_to_transaction (jito-foundation#374)

Updates bootstrap and start scripts needed for local dev. (jito-foundation#384)

Remove Deprecated Cli Args (jito-foundation#387)

Master Rebase

improve simulate_bundle errors and response (jito-foundation#404)

derive Clone on accountoverrides (jito-foundation#416)

Add upsert to AccountOverrides (jito-foundation#419)

update jito-programs (jito-foundation#430)

[JIT-1661] Faster Autosnapshot (jito-foundation#436)

Reverts simulate_transaction result calls to upstream (jito-foundation#446)

Don't unlock accounts in TransactionBatches used during simulation (jito-foundation#449)

first pass at wiring up jito-plugin (jito-foundation#428)

[JIT-1713] Fix bundle's blockspace preallocation (jito-foundation#489)

[JIT-1708] Fix TOC TOU condition for relayer and block engine config (jito-foundation#491)

[JIT-1710] - Optimize Bundle Consumer Checks (jito-foundation#490)

Add Blockhash Metrics to Bundle Committer (jito-foundation#500)

add priority fee ix to mev-claim (jito-foundation#520)

Update Autosnapshot (jito-foundation#548)

Run MEV claims + reclaiming rent-exempt amounts in parallel. (jito-foundation#582)

Update CI (jito-foundation#584)
- Add recursive submodule checkouts.
- Re-add solana-secondary step

Add more release fixes (jito-foundation#585)

Fix more release urls (jito-foundation#588)

[JIT-1812] Fix blocking mutexs (jito-foundation#495)

 [JIT-1711] Compare the unprocessed transaction storage BundleStorage against a constant instead of VecDeque::capacity() (jito-foundation#587)

Automatically rebase Jito-Solana on a periodic basis. Send message on slack during any failures or success.

Fix periodic rebase jito-foundation#594

Fixes the following bugs in the periodic rebase:
Sends multiple messages on failure instead of one
Cancels entire job if one branch fails

Ignore buildkite curl errors for rebasing and try to keep curling until job times out (jito-foundation#597)

Sleep longer waiting for buildkite to start (jito-foundation#598)

correctly initialize account overrides (jito-foundation#595)

Fix: Ensure set contact info to UDP port instead of QUIC (jito-foundation#603)

Add fast replay branch to daily rebase (jito-foundation#607)

take a snapshot of all bundle accounts before sim (jito-foundation#13) (jito-foundation#615)

update jito-programs submodule

Add 2.0 to daily rebase (jito-foundation#626)

Export agave binaries during docker build (jito-foundation#627)

Buffer bundles that exceed processing time and make the allowed processing time longer (jito-foundation#611)

Publish releases to S3 and GCS (jito-foundation#633)

Rebase from different repos (jito-foundation#637)

Point SECURITY.md to immunefi (jito-foundation#671)

Loosen requirements on tip accounts touchable in BankingStage (jito-foundation#683)

Separate out broadcast + retransmit shredstream (jito-foundation#703)

Add packet flag for staked node (jito-foundation#705)

Add auto-rebase to v2.1 (jito-foundation#739)

Fix release github (jito-foundation#745)

Move block_cost_limit tracking to BankingStage in preparation for SIMD-0207 (jito-foundation#753)

Add precompile checks in BundleStage (jito-foundation#787)

Add auto-rebase to v2.2 (jito-foundation#818)

Add better error handling around missing transaction signatures for bundle id generation (jito-foundation#860)

Remove unwrap from authentication (jito-foundation#861)

Revert Jito-Solana WorkingBankEntry changes (jito-foundation#873)

Add libclang to Dockerfile (jito-foundation#885)

Remove the tip distributor code (jito-foundation#888)

Rebase: Update anchor to not use deprecated crates

Add TLS webpki roots back in (jito-foundation#933)

Remove trusted relayer packets (jito-foundation#952)

Fix shred retransmit (jito-foundation#954)

Add daily v3.0 rebase (jito-foundation#972)

[Master] Automatically use optimal Block Engine region (jito-foundation#974)

Disable autoconfig (jito-foundation#995)

Make shredstream optional (jito-foundation#997)

Fix flaky test (jito-foundation#1027)
Remove bundle reservation (jito-foundation#1025)

Ensure execution-based failures are dropped (jito-foundation#1072)

Update programs to newest tip distribution + tip payment code (jito-foundation#1063)

Remove commented out code (jito-foundation#1074)
This commit contains the contents migrated from the bam repository here: https://github.com/jito-labs/bam-client
Set ClientId based on if it is actively connected to the BAM Node; with Jito-Solana being the default until a bam_connection exists.
Problem

Implement pong response from the validator

Summary of Changes

This PR implements a simple ping-pong response mechanism for the BAM (Block Auction Market) connection system. The changes add handling for incoming ping messages by responding with pong messages, along with corresponding metrics tracking.

Changes:

Added ping message handling in the outbound message processing loop
Introduced three new metrics to track ping-related activity (ping_sent, outbound_ping_sent, outbound_ping_fail)
Updated the bam-protos subproject commit reference
Add unit tests to verify multicast TTL=64 is correctly set on UDP
sockets for both broadcast and retransmit stages.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Set IP_MULTICAST_TTL=64 on UDP broadcast and retransmit sockets so
multicast shred delivery works beyond a single network hop (kernel
default is 1).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

8 participants