Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion anchor/eth/src/event_processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ impl EventProcessor {
})?;

// Schedule validator for index lookup
if let Err(err) = index_lookup_queue.blocking_send(validator_pubkey) {
if let Err(err) = index_lookup_queue.send(validator_pubkey) {
error!(?err, "Failed to send validator to index lookup");
}

Expand Down
9 changes: 4 additions & 5 deletions anchor/eth/src/index_sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,17 @@ use ssv_types::{ValidatorIndex, ValidatorMetadata};
use task_executor::TaskExecutor;
use tokio::{
select,
sync::mpsc::{channel, Receiver, Sender},
sync::mpsc::{unbounded_channel, UnboundedReceiver, UnboundedSender},
time::sleep,
};
use tracing::{debug, error, info, warn};
use types::PublicKeyBytes;

pub type Tx = Sender<PublicKeyBytes>;
pub type Tx = UnboundedSender<PublicKeyBytes>;

const INDEX_SYNCER_NAME: &str = "validator_index_syncer";

const MAX_BATCH_SIZE: usize = 512;
const QUEUE_SIZE: usize = 4096;
const BATCHING_DELAY: Duration = Duration::from_secs(1);
const MAX_DELAY: Duration = Duration::from_secs(45);

Expand All @@ -28,15 +27,15 @@ pub fn start_validator_index_syncer(
db: Arc<NetworkDatabase>,
executor: TaskExecutor,
) -> Tx {
let (tx, rx) = channel(QUEUE_SIZE);
let (tx, rx) = unbounded_channel();
executor.spawn(validator_index_syncer(nodes, db, rx), INDEX_SYNCER_NAME);
tx
}

async fn validator_index_syncer(
nodes: Arc<BeaconNodeFallback<impl SlotClock>>,
db: Arc<NetworkDatabase>,
mut validator_queue_rx: Receiver<PublicKeyBytes>,
mut validator_queue_rx: UnboundedReceiver<PublicKeyBytes>,
) {
info!("Starting validator index syncer");

Expand Down