block start at

This commit is contained in:
Hardhat Chad
2025-08-21 16:39:40 -07:00
parent a7da1fe0aa
commit 5266482418
3 changed files with 5 additions and 0 deletions

View File

@@ -22,6 +22,9 @@ pub struct Block {
/// The authority of the miner who submitted the best hash.
pub best_hash_miner: Pubkey,
/// The timestamp at which the block starts mining.
pub start_at: i64,
/// The slot at which the block starts trading.
pub start_slot: u64,

View File

@@ -106,6 +106,7 @@ pub fn process_reset(accounts: &[AccountInfo<'_>], _data: &[u8]) -> ProgramResul
market.fee.cumulative = 0;
// Setup the next block start and end slots.
block_next.start_at = clock.unix_timestamp;
block_next.start_slot = clock.slot;
block_next.end_slot = clock.slot + config.block_duration;

View File

@@ -197,6 +197,7 @@ fn test_sniper_fees() {
reward: 0,
best_hash: [0; 32],
best_hash_miner: Pubkey::default(),
start_at: 0,
start_slot: 0,
end_slot: u64::MAX,
slot_hash: [0; 32],