reth_optimism_primitives/
bedrock.rs
1use alloy_consensus::{Header, EMPTY_OMMER_ROOT_HASH, EMPTY_ROOT_HASH};
4use alloy_primitives::{address, b256, bloom, bytes, B256, B64, U256};
5
6pub const TX_BLOCK_985: [u64; 2] = [19_022, 45_036];
12
13pub const TX_BLOCK_123_322: u64 = 123_542;
18
19pub const TX_BLOCK_1_133_328: [u64; 2] = [1_135_391, 1_144_468];
25
26pub const TX_BLOCK_1_244_152: u64 = 1_272_994;
31
32pub const BLOCK_NUMS_REPLAYED_TX: [u64; 6] = [
34 TX_BLOCK_985[0],
35 TX_BLOCK_985[1],
36 TX_BLOCK_123_322,
37 TX_BLOCK_1_133_328[0],
38 TX_BLOCK_1_133_328[1],
39 TX_BLOCK_1_244_152,
40];
41
42pub fn is_dup_tx(block_number: u64) -> bool {
45 if block_number > BLOCK_NUMS_REPLAYED_TX[5] {
46 return false
47 }
48
49 if BLOCK_NUMS_REPLAYED_TX.contains(&block_number) {
51 return true
52 }
53
54 false
55}
56
57pub const OVM_HEADER_1_HASH: B256 =
61 b256!("0xbee7192e575af30420cae0c7776304ac196077ee72b048970549e4f08e875453");
62
63pub const BEDROCK_HEADER_HASH: B256 =
67 b256!("0xdbf6a80fef073de06add9b0d14026d6e5a86c85f6d102c36d3d8e9cf89c2afd3");
68
69pub const BEDROCK_HEADER: Header = Header {
71 difficulty: U256::ZERO,
72 extra_data: bytes!("424544524f434b"),
73 gas_limit: 30000000,
74 gas_used: 0,
75 logs_bloom: bloom!(
76 "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
77 ),
78 nonce: B64::ZERO,
79 number: 105235063,
80 parent_hash: b256!("0x21a168dfa5e727926063a28ba16fd5ee84c814e847c81a699c7a0ea551e4ca50"),
81 receipts_root: EMPTY_ROOT_HASH,
82 state_root: b256!("0x920314c198da844a041d63bf6cbe8b59583165fd2229d1b3f599da812fd424cb"),
83 timestamp: 1686068903,
84 transactions_root: EMPTY_ROOT_HASH,
85 ommers_hash: EMPTY_OMMER_ROOT_HASH,
86 beneficiary: address!("0x4200000000000000000000000000000000000011"),
87 withdrawals_root: None,
88 mix_hash: B256::ZERO,
89 base_fee_per_gas: Some(0x3b9aca00),
90 blob_gas_used: None,
91 excess_blob_gas: None,
92 parent_beacon_block_root: None,
93 requests_hash: None,
94};
95
96pub const BEDROCK_HEADER_TTD: U256 = U256::ZERO;
98
99#[cfg(test)]
100mod tests {
101 use super::*;
102
103 #[test]
104 fn test_bedrock_header() {
105 assert_eq!(BEDROCK_HEADER.hash_slow(), BEDROCK_HEADER_HASH);
106 }
107}