Skip to content

Commit

Permalink
cargo fmt and clippy issues
Browse files Browse the repository at this point in the history
  • Loading branch information
godmodegalactus committed Jan 12, 2024
1 parent 2498950 commit c3da6ad
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
22 changes: 12 additions & 10 deletions cluster-endpoints/src/grpc_multiplex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ pub fn create_grpc_multiplex_blocks_subscription(
loop {
let confirmed_blocks_stream = {
let commitment_config = CommitmentConfig::confirmed();

let mut streams = Vec::new();
for grpc_source in &grpc_sources {
let stream = create_geyser_reconnecting_stream(
Expand All @@ -79,13 +79,13 @@ pub fn create_grpc_multiplex_blocks_subscription(
);
streams.push(stream);
}

create_multiplexed_stream(streams, BlockExtractor(commitment_config))
};

let finalized_blockmeta_stream = {
let commitment_config = CommitmentConfig::finalized();

let mut streams = Vec::new();
for grpc_source in &grpc_sources {
let stream = create_geyser_reconnecting_stream(
Expand All @@ -106,7 +106,7 @@ pub fn create_grpc_multiplex_blocks_subscription(
let mut last_finalized_slot: Slot = 0;
let mut cleanup_without_recv_blocks: u8 = 0;
let mut cleanup_without_recv_blocks_meta: u8 = 0;
const MAX_ALLOWED_CLEANUP_WITHOUT_RECV : u8 = 12; // 12*5 = 60s without recving data
const MAX_ALLOWED_CLEANUP_WITHOUT_RECV: u8 = 12; // 12*5 = 60s without recving data
loop {
tokio::select! {
confirmed_block = confirmed_blocks_stream.next() => {
Expand Down Expand Up @@ -206,31 +206,33 @@ pub fn create_grpc_multiplex_slots_subscription(
filter_by_commitment: Some(true),
},
);

let filter = SubscribeRequest {
slots,
accounts: Default::default(),
transactions: HashMap::new(),
entry: Default::default(),
blocks: HashMap::new(),
blocks_meta: HashMap::new(),
commitment: Some(yellowstone_grpc_proto::geyser::CommitmentLevel::Processed as i32),
commitment: Some(
yellowstone_grpc_proto::geyser::CommitmentLevel::Processed as i32,
),
accounts_data_slice: Default::default(),
ping: None,
};

let stream = create_geyser_reconnecting_stream(grpc_source.clone(), filter);
streams.push(stream);
}

create_multiplexed_stream(streams, SlotExtractor {})
};

let mut multiplex_stream = std::pin::pin!(multiplex_stream);
loop {
tokio::select! {
slot_data = multiplex_stream.next() => {
if let Some(slot_data) = slot_data {
if let Some(slot_data) = slot_data {
match multiplexed_messages_sender.send(slot_data) {
Ok(receivers) => {
trace!("sent data to {} receivers", receivers);
Expand Down
2 changes: 1 addition & 1 deletion core/src/quic_connection_utils.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use log::{info, trace, warn};
use log::{info, trace};
use quinn::{
ClientConfig, Connection, ConnectionError, Endpoint, EndpointConfig, IdleTimeout, SendStream,
TokioRuntime, TransportConfig,
Expand Down

0 comments on commit c3da6ad

Please sign in to comment.