reth icon indicating copy to clipboard operation
reth copied to clipboard

use alloy transaction types

Open mattsse opened this issue 1 year ago • 5 comments

the core tx types are quivalent to alloy's:

https://github.com/paradigmxyz/reth/blob/67f617646ce4b68a5096239238aa9209636ff500/crates/primitives/src/transaction/eip1559.rs#L13-L13

the only difference is the codec impl

https://github.com/paradigmxyz/reth/blob/67f617646ce4b68a5096239238aa9209636ff500/crates/primitives/src/transaction/eip1559.rs#L11-L11

we can implement codec by doing the same as for

https://github.com/paradigmxyz/reth/blob/67f617646ce4b68a5096239238aa9209636ff500/crates/storage/codecs/src/alloy/withdrawal.rs#L6-L11

TODO

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

This should be done in separate prs and involves

  • move existing struct def to https://github.com/paradigmxyz/reth/blob/67f617646ce4b68a5096239238aa9209636ff500/crates/storage/codecs/src/alloy/transaction.rs#L1-L1 impl codec for alloy types via into/from
  • phase out primitive transaction defs

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

mattsse avatar Jul 13 '24 07:07 mattsse