Skip to content
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

ensure builder always grabs the relays' proposer schedule at launch #235

Merged
merged 1 commit into from
May 2, 2024
Merged
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
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
Loading