Allow leader schedule up to one epoch in the future to be fetched, to… (#31538)

Allow leader schedule up to one epoch in the future to be fetched, to cover all available leader schedules.
This commit is contained in:
bji 2023-05-15 16:32:14 -07:00 committed by GitHub
parent eaaed0a726
commit c8b85177a8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -1007,8 +1007,8 @@ pub fn process_leader_schedule(
) -> ProcessResult {
let epoch_info = rpc_client.get_epoch_info()?;
let epoch = epoch.unwrap_or(epoch_info.epoch);
if epoch > epoch_info.epoch {
return Err(format!("Epoch {epoch} is in the future").into());
if epoch > (epoch_info.epoch + 1) {
return Err(format!("Epoch {epoch} is more than one epoch in the future").into());
}
let epoch_schedule = rpc_client.get_epoch_schedule()?;