diff --git a/stake_aggregate/Cargo.toml b/stake_aggregate/Cargo.toml index 7e2418c..185f1c0 100644 --- a/stake_aggregate/Cargo.toml +++ b/stake_aggregate/Cargo.toml @@ -50,6 +50,9 @@ yellowstone-grpc-proto = { path = "../../yellowstone-grpc/yellowstone-grpc-proto #yellowstone-grpc-client = "1.8.0+solana.1.16.1" #yellowstone-grpc-proto = "1.8.0+solana.1.16.1" +#yellowstone-grpc-client = "1.11.0+solana.1.16.14" +#yellowstone-grpc-proto = "1.10.0+solana.1.16.14" + solana-sdk = "1.16.14" solana-client = "1.16.14" solana-ledger = "1.16.14" diff --git a/stake_aggregate/src/epoch.rs b/stake_aggregate/src/epoch.rs index 3a55b56..f5a2bce 100644 --- a/stake_aggregate/src/epoch.rs +++ b/stake_aggregate/src/epoch.rs @@ -152,7 +152,11 @@ impl CurrentEpochSlotState { } fn manage_change_epoch(&mut self) -> Option { - if self.current_slot.confirmed_slot > self.current_epoch_end_slot() { + //execute leaderschedule calculus at the last slot of the current epoch. + //account change of the slot has been send. + //first epoch slot send all stake change and during this send no slot is send. + //to avoid to delay too much the schdule, start the calculus at the end of the epoch. + if self.current_slot.confirmed_slot >= self.current_epoch_end_slot() { log::info!("Change epoch at slot:{}", self.current_slot.confirmed_slot); self.current_epoch_value = self.get_current_epoch().get_next_epoch(&self);