1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
use consensus_types::{
executed_block::ExecutedBlock, quorum_cert::QuorumCert, timeout_certificate::TimeoutCertificate,
};
use diem_crypto::HashValue;
use std::sync::Arc;
mod block_store;
mod block_tree;
pub mod tracing;
pub use block_store::{sync_manager::BlockRetriever, BlockStore};
use consensus_types::{sync_info::SyncInfo, timeout_2chain::TwoChainTimeoutCertificate};
use diem_types::ledger_info::LedgerInfoWithSignatures;
pub trait BlockReader: Send + Sync {
fn block_exists(&self, block_id: HashValue) -> bool;
fn get_block(&self, block_id: HashValue) -> Option<Arc<ExecutedBlock>>;
fn ordered_root(&self) -> Arc<ExecutedBlock>;
fn commit_root(&self) -> Arc<ExecutedBlock>;
fn get_quorum_cert_for_block(&self, block_id: HashValue) -> Option<Arc<QuorumCert>>;
fn path_from_ordered_root(&self, block_id: HashValue) -> Option<Vec<Arc<ExecutedBlock>>>;
fn path_from_commit_root(&self, block_id: HashValue) -> Option<Vec<Arc<ExecutedBlock>>>;
fn highest_certified_block(&self) -> Arc<ExecutedBlock>;
fn highest_quorum_cert(&self) -> Arc<QuorumCert>;
fn highest_ordered_cert(&self) -> Arc<QuorumCert>;
fn highest_timeout_cert(&self) -> Option<Arc<TimeoutCertificate>>;
fn highest_2chain_timeout_cert(&self) -> Option<Arc<TwoChainTimeoutCertificate>>;
fn highest_ledger_info(&self) -> LedgerInfoWithSignatures;
fn sync_info(&self) -> SyncInfo;
}