Skip to content

feat: skew leader clock in poh-recorder#596

Closed
ksn6 wants to merge 1 commit intoanza-xyz:masterfrom
ksn6:skew-leader-clock
Closed

feat: skew leader clock in poh-recorder#596
ksn6 wants to merge 1 commit intoanza-xyz:masterfrom
ksn6:skew-leader-clock

Conversation

@ksn6
Copy link
Copy Markdown
Contributor

@ksn6 ksn6 commented Nov 10, 2025

Problem and Summary of Changes

The leader shouldn't populate the block footer clock with just the raw clock value.

Rather, the leader should populate the clock with bounds, as specified in solana-foundation/solana-improvement-documents#363.

@ksn6 ksn6 force-pushed the skew-leader-clock branch from 54a1974 to 0db2bf9 Compare November 10, 2025 21:43
@ksn6 ksn6 enabled auto-merge (squash) November 10, 2025 21:44
.min(max_working_bank_time)
}

pub fn working_bank_block_producer_time_nanos(&self) -> u64 {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this value also needs to go into the clock sysvar right? seems we should do it in bank.freeze

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should already happen, no?

Copy link
Copy Markdown
Contributor

@AshwinSekar AshwinSekar Nov 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 things:

We only send out the footer once the bank is frozen. Once a bank is frozen no more account updates should be made (the state of the bank is "frozen").

There is no "leader replay", replay just checks to see if the bank is full and calls freeze. The blockstore processor call line is only used for non leader banks

if bank.collector_id() != my_pubkey {
let mut replay_blockstore_time = Measure::start("replay_blockstore_into_bank");
let blockstore_result = Self::replay_blockstore_into_bank(

For leader banks transactions are recorded into the bank directly by banking stage
fn process_and_record_transactions_with_pre_results(

And ticks are registered directly via poh recorder.

This is why a bank can become frozen before it has been done shredding

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So i think when we freeze our bank we should create and update the clock, as well as apply the state changes associated with the rewards.
Then when we're producing our footer we can grab these details for shredding.

Basically need to ensure that the leader and replayer will end up with the same bank hash in the end.

@ksn6 ksn6 changed the title poh-recorder: skew leader clock feat(poh-recorder): skew leader clock Nov 10, 2025
@ksn6 ksn6 changed the title feat(poh-recorder): skew leader clock feat, poh-recorder: skew leader clock Nov 10, 2025
@ksn6 ksn6 changed the title feat, poh-recorder: skew leader clock feat(poh-recorder): skew leader clock Nov 10, 2025
@ksn6 ksn6 changed the title feat(poh-recorder): skew leader clock feat: skew leader clock in poh-recorder Nov 10, 2025
@ksn6 ksn6 force-pushed the skew-leader-clock branch from 0db2bf9 to 0580c46 Compare November 10, 2025 22:28
@ksn6 ksn6 closed this Nov 11, 2025
auto-merge was automatically disabled November 11, 2025 21:34

Pull request was closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants