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
This commit is contained in:
@ -12,6 +12,8 @@ pub struct ConfirmedBlock {
|
||||
pub rewards: ::prost::alloc::vec::Vec<Reward>,
|
||||
#[prost(message, optional, tag = "6")]
|
||||
pub block_time: ::core::option::Option<UnixTimestamp>,
|
||||
#[prost(message, optional, tag = "7")]
|
||||
pub block_height: ::core::option::Option<BlockHeight>,
|
||||
}
|
||||
#[derive(Clone, PartialEq, ::prost::Message)]
|
||||
pub struct ConfirmedTransaction {
|
||||
@ -130,6 +132,11 @@ pub struct UnixTimestamp {
|
||||
#[prost(int64, tag = "1")]
|
||||
pub timestamp: i64,
|
||||
}
|
||||
#[derive(Clone, PartialEq, ::prost::Message)]
|
||||
pub struct BlockHeight {
|
||||
#[prost(uint64, tag = "1")]
|
||||
pub block_height: u64,
|
||||
}
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
|
||||
#[repr(i32)]
|
||||
pub enum RewardType {
|
||||
|
@ -66,7 +66,7 @@ pub enum TransactionErrorType {
|
||||
InvalidProgramForExecution = 13,
|
||||
SanitizeFailure = 14,
|
||||
ClusterMaintenance = 15,
|
||||
AccountBorrowOutstanding = 16,
|
||||
AccountBorrowOutstandingTx = 16,
|
||||
}
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
|
||||
#[repr(i32)]
|
||||
|
Reference in New Issue
Block a user