feat: skew leader clock in poh-recorder#596
Conversation
54a1974 to
0db2bf9
Compare
| .min(max_working_bank_time) | ||
| } | ||
|
|
||
| pub fn working_bank_block_producer_time_nanos(&self) -> u64 { |
There was a problem hiding this comment.
this value also needs to go into the clock sysvar right? seems we should do it in bank.freeze
There was a problem hiding this comment.
this should already happen, no?
-
when the leader sends out the footer, broadcast populates blockstore
-
and then on the leader's replay, block component processor runs
-
once feat: update clock sysvar in
BlockComponentProcessor#595 lands, the clock sysvar gets populated
There was a problem hiding this comment.
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
alpenglow/core/src/replay_stage.rs
Lines 3464 to 3466 in 4bfe9ed
For leader banks transactions are recorded into the bank directly by banking stage
alpenglow/core/src/banking_stage/consumer.rs
Line 174 in 4bfe9ed
And ticks are registered directly via poh recorder.
This is why a bank can become frozen before it has been done shredding
There was a problem hiding this comment.
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.
poh-recorder: skew leader clockpoh-recorder): skew leader clock
poh-recorder): skew leader clockpoh-recorder: skew leader clock
poh-recorder: skew leader clockpoh-recorder): skew leader clock
poh-recorder): skew leader clockpoh-recorder
0db2bf9 to
0580c46
Compare
Pull request was closed
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.