Skip to content

Automatically use optimal Block Engine region #920

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 12 commits into
base: seg/v2.2.19-jito
Choose a base branch
from

Conversation

esemeniuc
Copy link
Contributor

@esemeniuc esemeniuc commented Jul 9, 2025

This pull request introduces several changes aimed at improving the handling of configuration by adding support for dynamic Block Engine endpoint discovery. Whenever the connection with the block engine is broken, we automatically try to connect to the best available region.

Changes:

  • Implemented dynamic Block Engine endpoint discovery using latency-based selection via a new ping utility
  • Introduced a disable_block_engine_autoconfig flag in BlockEngineConfig to allow users to bypass automatic endpoint discovery
  • Replaced RwLock with ArcSwap for shred_receiver_address to avoid acquiring a lock per sent shred batch

@esemeniuc esemeniuc changed the base branch from master to seg/v2.2.19-jito July 9, 2025 19:01
@esemeniuc esemeniuc force-pushed the eric/discovery-service branch 3 times, most recently from 91cf267 to 89a10a9 Compare July 11, 2025 14:15
})?;
Self::get_endpoint(local_block_engine_config.block_engine_url.clone())?;

if !local_block_engine_config.disable_block_engine_autoconfig {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

use new discovery stuff here

@esemeniuc esemeniuc force-pushed the eric/discovery-service branch from d0daeb8 to f58d38f Compare July 11, 2025 15:25
@esemeniuc esemeniuc changed the title Eric/discovery service Connect to Block Engine to determine ideal region Jul 11, 2025
@esemeniuc esemeniuc requested a review from buffalu July 11, 2025 15:26
@esemeniuc esemeniuc changed the title Connect to Block Engine to determine ideal region Automatically use optimal Block Engine region Jul 11, 2025
@esemeniuc esemeniuc changed the base branch from seg/v2.2.19-jito to v2.2 July 11, 2025 20:02
@esemeniuc esemeniuc changed the base branch from v2.2 to seg/v2.2.19-jito July 11, 2025 20:03
@@ -121,7 +122,8 @@ impl BroadcastStageType {
bank_forks: Arc<RwLock<BankForks>>,
shred_version: u16,
quic_endpoint_sender: AsyncSender<(SocketAddr, Bytes)>,
shred_receiver_address: Arc<RwLock<Option<SocketAddr>>>,
shredstream_receiver_address: Arc<ArcSwap<Option<SocketAddr>>>,
Copy link
Contributor

Choose a reason for hiding this comment

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

what is the difference between shredstream_receiver_address and shred_receiver_address?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

1 is auto configured, 1 is manually configured. we dedup if they are the same

@esemeniuc esemeniuc force-pushed the eric/discovery-service branch from f8f9e87 to 4f13711 Compare July 15, 2025 17:06
@@ -206,28 +400,6 @@ impl BlockEngineStage {
// Get a copy of configs here in case they have changed at runtime
let keypair = cluster_info.keypair().clone();

let mut backend_endpoint =
Copy link
Contributor Author

@esemeniuc esemeniuc Jul 15, 2025

Choose a reason for hiding this comment

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

moved to endpoint parameter and get_endpoint

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.

2 participants