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
//! Receipt type with precomputed block-level metadata.
use crateReceipt;
use ;
/// A receipt with precomputed block-level metadata.
///
/// Cold storage backends store this type instead of raw [`Receipt`] to
/// avoid recomputing per-receipt metadata at query time.
///
/// # Fields
///
/// - `tx_hash`: avoids joining with the transactions table during log
/// queries.
/// - `first_log_index`: the absolute index of this receipt's first log
/// within the block (sum of log counts from all preceding receipts).
/// Avoids O(N) iteration over prior receipts when building
/// `ColdReceipt` or RPC log responses.
/// - `gas_used`: per-transaction gas consumed. Precomputed from the
/// cumulative gas sequence at append time to avoid needing prior
/// receipt lookups at query time.