Skip to content

Commit

Permalink
chore(consensus): Migrate deposit source to maili-common (#377)
Browse files Browse the repository at this point in the history
Migrates deposit source types to `maili-common`

---------

Co-authored-by: refcell <[email protected]>
  • Loading branch information
emhane and refcell authored Jan 13, 2025
1 parent 8a45317 commit 3e721aa
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 149 deletions.
8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ alloy-sol-types = { version = "0.8.12", default-features = false }
alloy-primitives = { version = "0.8.12", default-features = false }

# Maili
maili-provider = { version = "0.1.0", default-features = false }
maili-protocol = { version = "0.1.0", default-features = false }
maili-registry = { version = "0.1.0", default-features = false }
maili-rpc-types-engine = { version = "0.1.0", default-features = false }
maili-provider = { version = "0.1.3", default-features = false }
maili-protocol = { version = "0.1.3", default-features = false }
maili-registry = { version = "0.1.3", default-features = false }
maili-common = { version = "0.1.3", default-features = false }

# Revm
revm = "19.0.0"
Expand Down
19 changes: 17 additions & 2 deletions crates/consensus/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ alloy-eips.workspace = true
alloy-consensus.workspace = true
alloy-primitives = { workspace = true, features = ["rlp"] }

# Maili
maili-common.workspace = true

# misc
thiserror.workspace = true
derive_more = { workspace = true, features = ["display"] }
Expand All @@ -44,7 +47,12 @@ alloy-primitives = { workspace = true, features = ["rand", "arbitrary"] }

[features]
default = ["std"]
std = ["alloy-eips/std", "alloy-consensus/std", "derive_more/std"]
std = [
"alloy-eips/std",
"alloy-consensus/std",
"maili-common/std",
"derive_more/std",
]
k256 = ["alloy-primitives/k256", "alloy-consensus/k256"]
kzg = ["alloy-eips/kzg", "alloy-consensus/kzg", "std"]
arbitrary = [
Expand All @@ -55,5 +63,12 @@ arbitrary = [
"alloy-primitives/rand",
"alloy-primitives/arbitrary",
]
serde = ["dep:serde", "dep:alloy-serde", "alloy-primitives/serde", "alloy-consensus/serde", "alloy-eips/serde"]
serde = [
"dep:serde",
"dep:alloy-serde",
"alloy-primitives/serde",
"alloy-consensus/serde",
"alloy-eips/serde",
"maili-common/serde",
]
serde-bincode-compat = ["serde_with"]
3 changes: 2 additions & 1 deletion crates/consensus/src/hardforks/ecotone.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
use alloc::{string::String, vec::Vec};
use alloy_eips::eip2718::Encodable2718;
use alloy_primitives::{address, hex, Address, Bytes, TxKind, B256, U256};
use maili_common::UpgradeDepositSource;

use crate::{Hardfork, TxDeposit, UpgradeDepositSource};
use crate::{Hardfork, TxDeposit};

/// The Ecotone network upgrade transactions.
#[derive(Debug, Default, Clone, Copy)]
Expand Down
3 changes: 2 additions & 1 deletion crates/consensus/src/hardforks/fjord.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
use alloc::{string::String, vec::Vec};
use alloy_eips::eip2718::Encodable2718;
use alloy_primitives::{address, hex, Address, Bytes, TxKind, B256, U256};
use maili_common::UpgradeDepositSource;

use crate::{Hardfork, TxDeposit, UpgradeDepositSource};
use crate::{Hardfork, TxDeposit};

/// The Fjord network upgrade transactions.
#[derive(Debug, Default, Clone, Copy)]
Expand Down
5 changes: 2 additions & 3 deletions crates/consensus/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@ pub use receipt::{OpDepositReceipt, OpDepositReceiptWithBloom, OpReceiptEnvelope

mod transaction;
pub use transaction::{
DepositSourceDomain, DepositSourceDomainIdentifier, DepositTransaction, L1InfoDepositSource,
OpPooledTransaction, OpTxEnvelope, OpTxType, OpTypedTransaction, TxDeposit,
UpgradeDepositSource, UserDepositSource, DEPOSIT_TX_TYPE_ID,
DepositTransaction, OpPooledTransaction, OpTxEnvelope, OpTxType, OpTypedTransaction, TxDeposit,
DEPOSIT_TX_TYPE_ID,
};

pub mod eip1559;
Expand Down
6 changes: 0 additions & 6 deletions crates/consensus/src/transaction/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,6 @@ pub use typed::OpTypedTransaction;
mod pooled;
pub use pooled::OpPooledTransaction;

mod source;
pub use source::{
DepositSourceDomain, DepositSourceDomainIdentifier, L1InfoDepositSource, UpgradeDepositSource,
UserDepositSource,
};

#[cfg(feature = "serde")]
pub use deposit::serde_deposit_tx_rpc;

Expand Down
128 changes: 0 additions & 128 deletions crates/consensus/src/transaction/source.rs

This file was deleted.

3 changes: 0 additions & 3 deletions crates/rpc-types-engine/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ alloy-rpc-types-engine.workspace = true

# Maili
maili-protocol.workspace = true
maili-rpc-types-engine = { workspace = true, default-features = false }

# Encoding
snap = { workspace = true, optional = true }
Expand Down Expand Up @@ -55,14 +54,12 @@ std = [
"alloy-rpc-types-engine/std",
"op-alloy-consensus/std",
"maili-protocol/std",
"maili-rpc-types-engine/std",
]
serde = [
"dep:serde",
"dep:alloy-serde",
"maili-protocol/serde",
"alloy-rpc-types-engine/serde",
"maili-rpc-types-engine/serde",
]
arbitrary = [
"std",
Expand Down
1 change: 0 additions & 1 deletion crates/rpc-types-engine/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
extern crate alloc;

pub use alloy_rpc_types_engine::ForkchoiceUpdateVersion;
pub use maili_rpc_types_engine::*;

mod attributes;
pub use attributes::{OpAttributesWithParent, OpPayloadAttributes};
Expand Down

0 comments on commit 3e721aa

Please sign in to comment.