Skip to content
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 9 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ publish = false
[workspace]
resolver = "3"
members = [
"crates/chainspec",
"crates/evm",
"crates/payload/builder",
"crates/payload/types",
"crates/primitives",
"crates/revm",
"crates/chainspec",
"crates/evm",
"crates/payload/builder",
"crates/payload/types",
"crates/primitives",
"crates/revm",
]

[workspace.lints]
Expand Down Expand Up @@ -95,7 +95,9 @@ reth-revm = { git = "https://github.com/paradigmxyz/reth", rev = "64909d3", feat
"std",
"optional-checks",
] }
revm = { version = "33.1.0", features = ["optional_fee_charge"] }
revm = { version = "33.1.0", features = [
"optional_fee_charge",
], default-features = false }

alloy = { version = "1.1.3", default-features = false }
alloy-consensus = { version = "1.1.3", default-features = false }
Expand Down Expand Up @@ -156,6 +158,5 @@ tracing = "0.1.41"
tracing-subscriber = "0.3.19"
criterion = "0.7.0"
test-case = "3"
secp256k1 = "0.30.0"
pyroscope = "0.5.8"
pyroscope_pprofrs = "0.2.10"
2 changes: 1 addition & 1 deletion crates/chainspec/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ serde.workspace = true
serde_json.workspace = true

[features]
default = ["serde", "cli"]
default = ["serde"]
serde = [
"alloy-eips/serde",
"alloy-hardforks/serde",
Expand Down
3 changes: 2 additions & 1 deletion crates/evm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ serde_json.workspace = true
alloy-genesis.workspace = true

[features]
default = ["rpc"]
default = []
reth-codec = ["morph-primitives/reth-codec"]
rpc = ["dep:reth-rpc-eth-api", "morph-revm/rpc"]
engine = []
1 change: 1 addition & 0 deletions crates/evm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ impl BlockExecutorFactory for MorphEvmConfig {
}
}

#[cfg(feature = "reth-codec")]
impl ConfigureEvm for MorphEvmConfig {
type Primitives = MorphPrimitives;
type Error = MorphEvmError;
Expand Down
2 changes: 1 addition & 1 deletion crates/payload/types/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ workspace = true

[dependencies]
# Morph
morph-primitives = { workspace = true, features = ["serde"] }
morph-primitives = { workspace = true, features = ["serde", "reth-codec"] }

# Reth
reth-payload-primitives.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion crates/primitives/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ modular-bitfield = { version = "0.11.2", optional = true }
[dev-dependencies]

[features]
default = ["serde", "reth-codec"]
default = ["serde", "reth"]
serde = [
"dep:serde",
"dep:alloy-serde",
Expand Down
2 changes: 2 additions & 0 deletions crates/primitives/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ pub use transaction::{
#[non_exhaustive]
pub struct MorphPrimitives;


#[cfg(feature = "reth-codec")]
impl NodePrimitives for MorphPrimitives {
type Block = Block;
type BlockHeader = MorphHeader;
Expand Down
18 changes: 17 additions & 1 deletion crates/primitives/src/transaction/envelope.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use alloy_consensus::{Signed, TransactionEnvelope, TxEip1559, TxEip2930, TxEip7702, TxLegacy};
use alloy_primitives::{B256, Bytes};
use alloy_primitives::{B256, Bytes, U256};
use alloy_rlp::BytesMut;

use crate::{TxAltFee, TxL1Msg};
Expand Down Expand Up @@ -70,6 +70,22 @@ impl MorphTxEnvelope {
}
Bytes(bytes.freeze())
}

/// Returns the fee token id if this is an AltFee transaction.
pub fn fee_token_id(&self) -> Option<u16> {
match self {
Self::AltFee(tx) => Some(tx.tx().fee_token_id),
_ => None,
}
}

/// Returns the fee limit if this is an AltFee transaction.
pub fn fee_limit(&self) -> Option<U256> {
match self {
Self::AltFee(tx) => Some(tx.tx().fee_limit),
_ => None,
}
}
}

impl reth_primitives_traits::InMemorySize for MorphTxEnvelope {
Expand Down
10 changes: 10 additions & 0 deletions crates/revm/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,20 @@ pub enum MorphInvalidTransaction {
#[error("Token with ID {0} is not registered")]
TokenNotRegistered(u16),

/// Token ID 0 not supported for gas payment.
#[error("Token ID 0 is not supported for gas payment")]
TokenIdZeroNotSupported,

/// Token is not active for gas payment.
#[error("Token with ID {0} is not active for gas payment")]
TokenNotActive(u16),

#[error("Token transfer failed: {reason}")]
TokenTransferFailed {
/// Token transfer failure reason.
reason: String,
},

/// Insufficient token balance for gas payment.
#[error(
"Insufficient token balance for gas payment: required {required}, available {available}"
Expand Down
Loading
Loading