Skip to content

Commit

Permalink
ensure builder always grabs the relays' proposer schedule at launch
Browse files Browse the repository at this point in the history
  • Loading branch information
ralexstokes committed May 2, 2024
1 parent 945d3f3 commit 4a466b6
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions mev-build-rs/src/auctioneer/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ impl<
}
}

async fn fetch_proposer_schedules(&mut self, slot: Slot) {
async fn fetch_proposer_schedules(&mut self) {
// TODO: consider moving to new task on another thread, can do parallel fetch (join set)
// and not block others at this interval
// TODO: batch updates to auction schedule
Expand All @@ -189,7 +189,7 @@ impl<
match relay.get_proposal_schedule().await {
Ok(schedule) => {
let slots = self.auction_schedule.process(relay.clone(), &schedule);
info!(slot, ?slots, %relay, "processed proposer schedule");
info!(?slots, %relay, "processed proposer schedule");
}
Err(err) => {
warn!(err = %err, "error fetching proposer schedule from relay")
Expand All @@ -201,7 +201,7 @@ impl<
async fn on_slot(&mut self, slot: Slot) {
debug!(slot, "processed");
if (slot * PROPOSAL_SCHEDULE_INTERVAL) % self.context.slots_per_epoch == 0 {
self.fetch_proposer_schedules(slot).await;
self.fetch_proposer_schedules().await;
}
}

Expand Down Expand Up @@ -393,6 +393,9 @@ impl<
}
}

// initialize proposer schedule
self.fetch_proposer_schedules().await;

let mut payload_events =
self.builder.subscribe().await.expect("can subscribe to events").into_stream();

Expand Down

0 comments on commit 4a466b6

Please sign in to comment.