reth_db/static_file/
masks.rs

1use crate::{
2    add_static_file_mask,
3    static_file::mask::{ColumnSelectorOne, ColumnSelectorTwo},
4    BlockBodyIndices, HeaderTerminalDifficulties,
5};
6use alloy_primitives::BlockHash;
7use reth_db_api::{
8    models::{StaticFileBlockWithdrawals, StoredBlockOmmers},
9    table::Table,
10};
11
12// HEADER MASKS
13add_static_file_mask! {
14    #[doc = "Mask for selecting a single header from Headers static file segment"]
15    HeaderMask<H>, H, 0b001
16}
17add_static_file_mask! {
18    #[doc = "Mask for selecting a total difficulty value from Headers static file segment"]
19    TotalDifficultyMask, <HeaderTerminalDifficulties as Table>::Value, 0b010
20}
21add_static_file_mask! {
22    #[doc = "Mask for selecting a block hash value from Headers static file segment"]
23    BlockHashMask, BlockHash, 0b100
24}
25add_static_file_mask! {
26    #[doc = "Mask for selecting a header along with block hash from Headers static file segment"]
27    HeaderWithHashMask<H>, H, BlockHash, 0b101
28}
29add_static_file_mask! {
30    #[doc = "Mask for selecting a total difficulty along with block hash from Headers static file segment"]
31    TDWithHashMask,
32    <HeaderTerminalDifficulties as Table>::Value,
33    BlockHash,
34    0b110
35}
36
37// RECEIPT MASKS
38add_static_file_mask! {
39    #[doc = "Mask for selecting a single receipt from Receipts static file segment"]
40    ReceiptMask<R>, R, 0b1
41}
42
43// TRANSACTION MASKS
44add_static_file_mask! {
45    #[doc = "Mask for selecting a single transaction from Transactions static file segment"]
46    TransactionMask<T>, T, 0b1
47}
48
49// BLOCK_META MASKS
50add_static_file_mask! {
51    #[doc = "Mask for a `StoredBlockBodyIndices` from BlockMeta static file segment"]
52    BodyIndicesMask, <BlockBodyIndices as Table>::Value, 0b001
53}
54add_static_file_mask! {
55    #[doc = "Mask for a `StoredBlockOmmers` from BlockMeta static file segment"]
56    OmmersMask<H>, StoredBlockOmmers<H>, 0b010
57}
58add_static_file_mask! {
59    #[doc = "Mask for a `StaticFileBlockWithdrawals` from BlockMeta static file segment"]
60    WithdrawalsMask, StaticFileBlockWithdrawals, 0b100
61}