1use alloy_eips::eip7840::BlobParams;
2use alloy_primitives::Bytes;
3use alloy_rpc_types::TransactionRequest;
4use alloy_serde::WithOtherFields;
5use serde::{Deserialize, Serialize};
6
7#[derive(Debug, Clone, Deserialize)]
9pub struct ReorgOptions {
10 pub depth: u64,
12 pub tx_block_pairs: Vec<(TransactionData, u64)>,
14}
15
16#[derive(Debug, Clone, Deserialize)]
17#[serde(untagged)]
18#[expect(clippy::large_enum_variant)]
19pub enum TransactionData {
20 JSON(WithOtherFields<TransactionRequest>),
21 Raw(Bytes),
22}
23
24#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize)]
29#[serde(rename_all = "camelCase")]
30pub struct NodeBlobParams {
31 pub target_blob_count: u64,
32 pub max_blob_count: u64,
33 #[serde(with = "alloy_serde::quantity")]
34 pub update_fraction: u128,
35 #[serde(with = "alloy_serde::quantity")]
36 pub min_blob_fee: u128,
37 pub max_blobs_per_tx: u64,
38 pub blob_base_cost: u64,
39}
40
41impl From<BlobParams> for NodeBlobParams {
42 fn from(params: BlobParams) -> Self {
43 let BlobParams {
44 target_blob_count,
45 max_blob_count,
46 update_fraction,
47 min_blob_fee,
48 max_blobs_per_tx,
49 blob_base_cost,
50 } = params;
51 Self {
52 target_blob_count,
53 max_blob_count,
54 update_fraction,
55 min_blob_fee,
56 max_blobs_per_tx,
57 blob_base_cost,
58 }
59 }
60}
61
62impl From<NodeBlobParams> for BlobParams {
63 fn from(params: NodeBlobParams) -> Self {
64 let NodeBlobParams {
65 target_blob_count,
66 max_blob_count,
67 update_fraction,
68 min_blob_fee,
69 max_blobs_per_tx,
70 blob_base_cost,
71 } = params;
72 Self {
73 target_blob_count,
74 max_blob_count,
75 update_fraction,
76 min_blob_fee,
77 max_blobs_per_tx,
78 blob_base_cost,
79 }
80 }
81}