reth icon indicating copy to clipboard operation
reth copied to clipboard

replace reth BlobTransactionSidecar with alloy's

Open mattsse opened this issue 1 year ago • 10 comments

Describe the feature

with this https://github.com/alloy-rs/alloy/pull/677

we can remove this entirely:

https://github.com/paradigmxyz/reth/blob/ead753db4c96f5f9f0fd2867106d88ef6d312405/crates/primitives/src/transaction/sidecar.rs#L309-L319

and this implementation as well

https://github.com/paradigmxyz/reth/blob/ead753db4c96f5f9f0fd2867106d88ef6d312405/crates/primitives/src/transaction/eip4844.rs#L118-L123

Additional context

No response

mattsse avatar May 03 '24 21:05 mattsse

hey there, is the issue open or blocked by the alloy pr?

mahesh-dalle avatar May 04 '24 11:05 mahesh-dalle

should be ready now, last blocker is possibly https://github.com/alloy-rs/alloy/pull/679 but doesn't impact changes just --all-features compilation

do you want to take this?

first we need to bump the alloy deps here and https://github.com/paradigmxyz/evm-inspectors

mattsse avatar May 04 '24 11:05 mattsse

Yes, i would like to try this.

mahesh-dalle avatar May 04 '24 11:05 mahesh-dalle

nice, if you have any questions etc, please open a draft pr and we take it from there

mattsse avatar May 04 '24 12:05 mattsse

Well, before opening a draft can u please dump as many pointers as you can. Also from what i understand , we need to delete the struct and all the impls related to it what do we exactly import from alloy for BlobTransactionSidecar?, also we need to delete the validate_blob function and import it from alloy_consensus right?

mahesh-dalle avatar May 04 '24 18:05 mahesh-dalle

we need to delete the struct and all the impls related to it what do we exactly import from alloy for BlobTransactionSidecar?, also we need to delete the validate_blob function and import it from alloy_consensus right?

yes to all of this

mattsse avatar May 05 '24 09:05 mattsse

we need to delete the struct and all the impls related to it what do we exactly import from alloy for BlobTransactionSidecar?, also we need to delete the validate_blob function and import it from alloy_consensus right?

yes to all of this Do we need this ? impl proptest::arbitrary::Arbitrary for BlobTransactionSidecar and BlobTransactionSidecarRlp ? cuz i am getting an error after removing the struct and impl for BlobTransactionSidecar.

error[E0117]: only traits defined in the current crate can be implemented for types defined outside of the crate
   --> crates/primitives/src/transaction/sidecar.rs:468:1
    |
468 | impl proptest::arbitrary::Arbitrary for BlobTransactionSidecar {
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^----------------------
    | |                                       |
    | |                                       `reth_rpc_types::BlobTransactionSidecar` is not defined in the current crate
    | impl doesn't use only types from inside the current crate
    |
    = note: define and implement a trait or new type instead

error[E0117]: only traits defined in the current crate can be implemented for types defined outside of the crate
   --> crates/primitives/src/transaction/sidecar.rs:443:1
    |
443 | impl<'a> arbitrary::Arbitrary<'a> for BlobTransactionSidecar {
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^----------------------
    | |                                     |
    | |                                     `reth_rpc_types::BlobTransactionSidecar` is not defined in the current crate
    | impl doesn't use only types from inside the current crate
    |
    = note: define and implement a trait or new type instead
    ```

mahesh-dalle avatar May 05 '24 11:05 mahesh-dalle

this is merged now:

https://github.com/alloy-rs/alloy/pull/677

mattsse avatar May 05 '24 11:05 mattsse

Hey i dont think i would be able to continue on this one. Will be out on a lookout for more easier GFIs.

mahesh-dalle avatar May 07 '24 08:05 mahesh-dalle

submitting a pr on this issue then.

guha-rahul avatar May 07 '24 09:05 guha-rahul