Skip to content

Commit

Permalink
Merge pull request #235 from ralexstokes/bugfix-builder-schedule-init
Browse files Browse the repository at this point in the history
ensure builder always grabs the relays' proposer schedule at launch
  • Loading branch information
ralexstokes authored May 2, 2024
2 parents 945d3f3 + 4a466b6 commit fb76b2a
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 fb76b2a

Please sign in to comment.