Skip to content
Open
Show file tree
Hide file tree
Changes from all 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.

16 changes: 9 additions & 7 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
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