mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
fix(op): filter out receipts for dup txns (#8400)
This commit is contained in:
12
crates/optimism/primitives/Cargo.toml
Normal file
12
crates/optimism/primitives/Cargo.toml
Normal file
@ -0,0 +1,12 @@
|
||||
[package]
|
||||
name = "reth-optimism-primitives"
|
||||
version.workspace = true
|
||||
edition.workspace = true
|
||||
rust-version.workspace = true
|
||||
license.workspace = true
|
||||
homepage.workspace = true
|
||||
repository.workspace = true
|
||||
description = "OP primitive types"
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
52
crates/optimism/primitives/src/bedrock_import.rs
Normal file
52
crates/optimism/primitives/src/bedrock_import.rs
Normal file
@ -0,0 +1,52 @@
|
||||
//! Replayed OP mainnet OVM transactions (in blocks below Bedrock).
|
||||
|
||||
/// Transaction 0x9ed8f713b2cc6439657db52dcd2fdb9cc944915428f3c6e2a7703e242b259cb9 in block 985,
|
||||
/// replayed in blocks:
|
||||
///
|
||||
/// 19 022
|
||||
/// 45 036
|
||||
pub const TX_BLOCK_985: [u64; 2] = [19_022, 45_036];
|
||||
|
||||
/// Transaction 0xc033250c5a45f9d104fc28640071a776d146d48403cf5e95ed0015c712e26cb6 in block
|
||||
/// 123 322, replayed in block:
|
||||
///
|
||||
/// 123 542
|
||||
pub const TX_BLOCK_123_322: u64 = 123_542;
|
||||
|
||||
/// Transaction 0x86f8c77cfa2b439e9b4e92a10f6c17b99fce1220edf4001e4158b57f41c576e5 in block
|
||||
/// 1 133 328, replayed in blocks:
|
||||
///
|
||||
/// 1 135 391
|
||||
/// 1 144 468
|
||||
pub const TX_BLOCK_1_133_328: [u64; 2] = [1_135_391, 1_144_468];
|
||||
|
||||
/// Transaction 0x3cc27e7cc8b7a9380b2b2f6c224ea5ef06ade62a6af564a9dd0bcca92131cd4e in block
|
||||
/// 1 244 152, replayed in block:
|
||||
///
|
||||
/// 1 272 994
|
||||
pub const TX_BLOCK_1_244_152: u64 = 1_272_994;
|
||||
|
||||
/// The six blocks with replayed transactions.
|
||||
pub const BLOCK_NUMS_REPLAYED_TX: [u64; 6] = [
|
||||
TX_BLOCK_985[0],
|
||||
TX_BLOCK_985[1],
|
||||
TX_BLOCK_123_322,
|
||||
TX_BLOCK_1_133_328[0],
|
||||
TX_BLOCK_1_133_328[1],
|
||||
TX_BLOCK_1_244_152,
|
||||
];
|
||||
|
||||
/// Returns `true` if transaction is the second or third appearance of the transaction. The blocks
|
||||
/// with replayed transaction happen to only contain the single transaction.
|
||||
pub fn is_dup_tx(block_number: u64) -> bool {
|
||||
if block_number > BLOCK_NUMS_REPLAYED_TX[5] {
|
||||
return false
|
||||
}
|
||||
|
||||
// these blocks just have one transaction!
|
||||
if BLOCK_NUMS_REPLAYED_TX.contains(&block_number) {
|
||||
return true
|
||||
}
|
||||
|
||||
false
|
||||
}
|
||||
10
crates/optimism/primitives/src/lib.rs
Normal file
10
crates/optimism/primitives/src/lib.rs
Normal file
@ -0,0 +1,10 @@
|
||||
//! Standalone crate for Optimism-specific Reth primitive types.
|
||||
|
||||
#![doc(
|
||||
html_logo_url = "https://raw.githubusercontent.com/paradigmxyz/reth/main/assets/reth-docs.png",
|
||||
html_favicon_url = "https://avatars0.githubusercontent.com/u/97369466?s=256",
|
||||
issue_tracker_base_url = "https://github.com/paradigmxyz/reth/issues/"
|
||||
)]
|
||||
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
|
||||
|
||||
pub mod bedrock_import;
|
||||
Reference in New Issue
Block a user