-
Notifications
You must be signed in to change notification settings - Fork 1.6k
refactor: move ExtendedTxEnvelope to reth-primitives-traits #16102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: move ExtendedTxEnvelope to reth-primitives-traits #16102
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ty, only have feature nits
/// A [`SignedTransaction`] implementation that combines the [`OpTxEnvelope`] and another | ||
/// transaction type. | ||
pub type ExtendedOpTxEnvelope<T> = ExtendedTxEnvelope<OpTxEnvelope, T>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this alias we can remove
use revm_primitives::{Address, Bytes, TxKind, B256, U256}; | ||
|
||
use crate::{ | ||
serde_bincode_compat::SerdeBincodeCompat, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this impl we need to feature gate, with
reth/crates/primitives-traits/Cargo.toml
Line 119 in 22452e8
serde-bincode-compat = [ |
@@ -9,12 +9,14 @@ use alloy_primitives::{bytes::Buf, ChainId, TxHash}; | |||
use alloy_rlp::{BufMut, Decodable, Encodable, Result as RlpResult}; | |||
use op_alloy_consensus::OpTxEnvelope; | |||
use reth_codecs::Compact; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we also need to feature gate this impl with reth-codecs
@@ -33,10 +35,14 @@ macro_rules! delegate { | |||
/// types must be unique. | |||
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, Hash, Eq, PartialEq)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we also need to feature gate serde, see other types in this crate for reference
a718c7e
to
fd97853
Compare
impl<Tx> TryFrom<ExtendedTxEnvelope<OpTxEnvelope, Tx>> | ||
for ExtendedTxEnvelope<OpPooledTransaction, Tx> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we either need to relax this so that this works for any Builtin type or feature gat behind op feature
} | ||
} | ||
} | ||
|
||
impl From<OpPooledTransaction> for ExtendedTxEnvelope<OpTxEnvelope, CustomTransactionEnvelope> { | ||
impl<Tx> From<OpPooledTransaction> for ExtendedTxEnvelope<OpTxEnvelope, Tx> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this also needs an op feature
{ | ||
fn to_compact<Buf>(&self, buf: &mut Buf) -> usize | ||
#[cfg(feature = "reth-codec")] | ||
mod compact { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to avoid this compact module and use full paths instead, this is how we do compact feature gate elsewhere
This PR moves
ExtendedTxEnvelope
and its impls to thereth-primitives-traits
crateresolves #16091