Add option to wait for a specific epoch length to bench-tps (#10083)
This commit is contained in:
@ -11,6 +11,7 @@ use crate::{
|
||||
account::Account,
|
||||
clock::Slot,
|
||||
commitment_config::CommitmentConfig,
|
||||
epoch_info::EpochInfo,
|
||||
fee_calculator::{FeeCalculator, FeeRateGovernor},
|
||||
hash::Hash,
|
||||
instruction::Instruction,
|
||||
@ -106,6 +107,8 @@ pub trait SyncClient {
|
||||
commitment_config: CommitmentConfig,
|
||||
) -> Result<u64>;
|
||||
|
||||
fn get_epoch_info(&self) -> Result<EpochInfo>;
|
||||
|
||||
/// Poll until the signature has been confirmed by at least `min_confirmed_blocks`
|
||||
fn poll_for_signature_confirmation(
|
||||
&self,
|
||||
|
17
sdk/src/epoch_info.rs
Normal file
17
sdk/src/epoch_info.rs
Normal file
@ -0,0 +1,17 @@
|
||||
use crate::clock::{Epoch, Slot};
|
||||
|
||||
#[derive(Serialize, Deserialize, Clone, Debug)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct EpochInfo {
|
||||
/// The current epoch
|
||||
pub epoch: Epoch,
|
||||
|
||||
/// The current slot, relative to the start of the current epoch
|
||||
pub slot_index: u64,
|
||||
|
||||
/// The number of slots in this epoch
|
||||
pub slots_in_epoch: u64,
|
||||
|
||||
/// The absolute current slot
|
||||
pub absolute_slot: Slot,
|
||||
}
|
@ -7,6 +7,7 @@ pub mod bpf_loader;
|
||||
pub mod clock;
|
||||
pub mod commitment_config;
|
||||
pub mod entrypoint_native;
|
||||
pub mod epoch_info;
|
||||
pub mod epoch_schedule;
|
||||
pub mod fee_calculator;
|
||||
pub mod hash;
|
||||
|
Reference in New Issue
Block a user