ckb_db_schema/lib.rs
1//! The schema include constants define the low level database column families.
2
3/// Column families alias type
4pub type Col = &'static str;
5/// Total column number
6pub const COLUMNS: u32 = 19;
7/// Column store chain index
8pub const COLUMN_INDEX: Col = "0";
9/// Column store block's header
10pub const COLUMN_BLOCK_HEADER: Col = "1";
11/// Column store block's body
12pub const COLUMN_BLOCK_BODY: Col = "2";
13/// Column store block's uncle and uncles’ proposal zones
14pub const COLUMN_BLOCK_UNCLE: Col = "3";
15/// Column store meta data
16pub const COLUMN_META: Col = "4";
17/// Column store transaction extra information
18pub const COLUMN_TRANSACTION_INFO: Col = "5";
19/// Column store block extra information
20pub const COLUMN_BLOCK_EXT: Col = "6";
21/// Column store block's proposal ids
22pub const COLUMN_BLOCK_PROPOSAL_IDS: Col = "7";
23/// Column store indicates track block epoch
24pub const COLUMN_BLOCK_EPOCH: Col = "8";
25/// Column store indicates track block epoch
26pub const COLUMN_EPOCH: Col = "9";
27/// Column store cell
28pub const COLUMN_CELL: Col = "10";
29/// Column store main chain consensus include uncles
30///
31/// <https://github.com/nervosnetwork/rfcs/blob/master/rfcs/0020-ckb-consensus-protocol/0020-ckb-consensus-protocol.md#specification>
32pub const COLUMN_UNCLES: Col = "11";
33/// Column store cell data
34pub const COLUMN_CELL_DATA: Col = "12";
35/// Column store block number-hash pair
36pub const COLUMN_NUMBER_HASH: Col = "13";
37/// Column store cell data hash
38pub const COLUMN_CELL_DATA_HASH: Col = "14";
39/// Column store block extension data
40pub const COLUMN_BLOCK_EXTENSION: Col = "15";
41/// Column store chain root MMR data
42pub const COLUMN_CHAIN_ROOT_MMR: Col = "16";
43/// Column store filter data for client-side filtering
44pub const COLUMN_BLOCK_FILTER: Col = "17";
45/// Column store filter data hash for client-side filtering
46pub const COLUMN_BLOCK_FILTER_HASH: Col = "18";
47
48/// META_TIP_HEADER_KEY tracks the latest known best block header
49pub const META_TIP_HEADER_KEY: &[u8] = b"TIP_HEADER";
50/// META_CURRENT_EPOCH_KEY tracks the latest known epoch
51pub const META_CURRENT_EPOCH_KEY: &[u8] = b"CURRENT_EPOCH";
52/// META_FILTER_DATA_KEY tracks the latest built filter data block hash
53pub const META_LATEST_BUILT_FILTER_DATA_KEY: &[u8] = b"LATEST_BUILT_FILTER_DATA";
54
55/// CHAIN_SPEC_HASH_KEY tracks the hash of chain spec which created current database
56pub const CHAIN_SPEC_HASH_KEY: &[u8] = b"chain-spec-hash";
57/// MIGRATION_VERSION_KEY tracks the current database version.
58pub const MIGRATION_VERSION_KEY: &[u8] = b"db-version";