-
Notifications
You must be signed in to change notification settings - Fork 253
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
Add trait methods to alloy_network_primitives::TransactionResponse
#1173
Conversation
…ween alloy_primitives::Signature and alloy_rpc_types_eth::Signature
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.
let's do the additional trait Transaction
first and think about the TransactionResponse fn(&impl Transaction) functions separately
that's exactly how it is done. see base of prs. first pr: #1172 |
sorry I missed that pr |
re-request review @mattsse |
extracted yet another bit #1198 |
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 can't really solve this on the type trait, this is a server side problem because only there this type is created
how come? this would be following pattern https://github.com/paradigmxyz/reth/blob/e6dc947a3728637aa3b0f78c893e8f24dc468357/crates/transaction-pool/src/traits.rs#L812-L819 |
…etwork_primitives::TransactionInfo
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.
converting types from consensus to rpc can't really be solved like this because this constrains it to alloy_consensus::Transaction
fn fill( | ||
signed_tx: Signed<impl alloy_consensus::Transaction>, | ||
signer: Address, | ||
tx_info: TransactionInfo, | ||
) -> Self { |
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.
these functions won't work, because they constrain type creation, we can not lock this in in the trait function
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.
how come?
closing this, because we can't support the fill feature like this, because this conversion is type specific. and the additional gas functions doesn't really make sense like this because this info should be encapsulated in the transaction itself, especially if we proceed with |
Motivation
Removing the optimism feature from
reth-rpc-types-compat
in a simple way, requires implementing the conversion from a signed transaction into an rpc transaction object, into the crates that define the associated types ofalloy_network::Network
. Otherwise, we are not able to access the additional OP fields for example.Moving into
reth-optimsim-rpc
is not an option, since neither the trait for conversion nor the<op_alloy_network::Optimism as Network>::TransactionResponse
type are defined in thereth-optimsim-rpc
crateSolution
Adds trait methods to
alloy_network_primitives::TransactionResponse
for filling aalloy_network_primitives::Transaction
fromalloy_consensus::Signed<impl alloy_consensus::Transaction>
.PR Checklist