Skip to content
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

use alloy transaction types #9484

Open
6 tasks
Tracked by #8721
mattsse opened this issue Jul 13, 2024 · 5 comments
Open
6 tasks
Tracked by #8721

use alloy transaction types #9484

mattsse opened this issue Jul 13, 2024 · 5 comments
Labels
C-debt A section of code is hard to understand or change D-good-first-issue Nice and easy! A great choice to get started

Comments

@mattsse
Copy link
Collaborator

mattsse commented Jul 13, 2024

the core tx types are quivalent to alloy's:

the only difference is the codec impl

we can implement codec by doing the same as for

/// Withdrawal acts as bridge which simplifies Compact implementation for AlloyWithdrawal.
///
/// Notice: Make sure this struct is 1:1 with `alloy_eips::eip4895::Withdrawal`
#[main_codec]
#[derive(Debug, Clone, PartialEq, Eq, Default)]
struct Withdrawal {

TODO

  • replace EIP1559
  • replace EIP2930
  • replace legacy
  • replace EIP4844
  • replace 7702
  • optimism deposit

This should be done in separate prs and involves

there are likely missing/renamed functions in alloy, so we need to surface those and add to alloy if appropriate

@mattsse mattsse added D-good-first-issue Nice and easy! A great choice to get started C-debt A section of code is hard to understand or change labels Jul 13, 2024
@leruaa
Copy link
Contributor

leruaa commented Jul 13, 2024

I can take this on.

@mattsse
Copy link
Collaborator Author

mattsse commented Jul 13, 2024

cool, this will likely be a bit painful, see #9485 for ref
we likely need to do some work on rlp for this

@leruaa
Copy link
Contributor

leruaa commented Jul 14, 2024

@mattsse Looking into this, it seems I will have to convert from reth Signature to alloy one at many places. Do you think I should work on migrating reth Signature to alloy as a prerequisite to this issue, or converting is ok for now?

For instance in the code below, I would like to call encoded_len_with_signature() on alloy TxLegacy that takes an alloy signature as a parameter:

Self::Legacy { transaction, signature, .. } => {
// method computes the payload len with a RLP header
transaction.payload_len_with_signature(signature)
}

@emhane
Copy link
Member

emhane commented Aug 4, 2024

is the end goal to replace reth_primitives::PooledTransactionsElement with alloy_consensus::TypedTransaction ? if so we'd be more efficient if we tackle this by making types that use reth_primitives::PooledTransactionElement generic over a type T: alloy_consensus::Transaction. do we have a complete list of types we want to replace with its alloy equivalent?

@emhane
Copy link
Member

emhane commented Aug 4, 2024

T: alloy_consensus::Transaction + <the codec trait>, and impl the codec trait for alloy types where we define the codec trait

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-debt A section of code is hard to understand or change D-good-first-issue Nice and easy! A great choice to get started
Projects
Status: Todo
Development

No branches or pull requests

3 participants