-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Add block height to ConfirmedBlock structs #17523
Add block height to ConfirmedBlock structs #17523
Conversation
4bcc388
to
8e24c3b
Compare
@@ -2126,6 +2126,9 @@ impl fmt::Display for CliBlock { | |||
if let Some(block_time) = self.encoded_confirmed_block.block_time { | |||
writeln!(f, "Block Time: {:?}", Local.timestamp(block_time, 0))?; | |||
} | |||
if let Some(block_height) = self.encoded_confirmed_block.block_height { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
heh, I foresee support issues when people now start running solana block <BLOCK>
instead of solana block <SLOT>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Totally. solana block-by-height
in our future?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
solana-ledger-tool slot ...
got it right though! oh well :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a JSON RPC doc update missing here right?
8e24c3b
to
04af03d
Compare
04af03d
to
060b995
Compare
Codecov Report
@@ Coverage Diff @@
## master #17523 +/- ##
=========================================
- Coverage 82.6% 82.6% -0.1%
=========================================
Files 427 427
Lines 119005 119057 +52
=========================================
+ Hits 98409 98421 +12
- Misses 20596 20636 +40 |
* Add BlockHeight CF to blockstore * Rename CacheBlockTimeService to be more general * Cache block-height using service * Fixup previous proto mishandling * Add block_height to block structs * Add block-height to solana block * Fallback to BankForks if block time or block height are not yet written to Blockstore * Add docs * Review comments (cherry picked from commit ab581da) # Conflicts: # core/src/replay_stage.rs # core/src/tvu.rs # core/src/validator.rs
* Add block height to ConfirmedBlock structs (#17523) * Add BlockHeight CF to blockstore * Rename CacheBlockTimeService to be more general * Cache block-height using service * Fixup previous proto mishandling * Add block_height to block structs * Add block-height to solana block * Fallback to BankForks if block time or block height are not yet written to Blockstore * Add docs * Review comments (cherry picked from commit ab581da) # Conflicts: # core/src/replay_stage.rs # core/src/tvu.rs # core/src/validator.rs * Fix conflicts Co-authored-by: Tyera Eulberg <[email protected]> Co-authored-by: Tyera Eulberg <[email protected]>
Problem
As of #17506,
last_valid_block_height
is available to assess recent-blockhash expiration. But it is only possible to get the block height of the current Bank (viagetBlockHeight
orgetEpochInfo
rpcs).Summary of Changes