reth icon indicating copy to clipboard operation
reth copied to clipboard

Replace ethsigner trait with alloy-signer

Open mattsse opened this issue 10 months ago • 16 comments

Describe the feature

we now have alloy-signer as dependency, and the EthSigner trait:

https://github.com/paradigmxyz/reth/blob/b89af430e2f45f8a6e53776a6e5150c1b21458c6/crates/rpc/rpc/src/eth/signer.rs#L19-L19

can now be replaced with alloy signer traits (NetworkSigner)

we can also replace all the typedtransaction types: https://github.com/paradigmxyz/reth/blob/b89af430e2f45f8a6e53776a6e5150c1b21458c6/crates/rpc/rpc-types/src/eth/transaction/typed.rs#L18-L18

in favor of https://github.com/alloy-rs/alloy/blob/098907b76208f786f3070e23c76428d692e94dc3/crates/network/src/transaction/builder.rs#L48-L48 which is implemented for TransactionRequest

https://github.com/alloy-rs/alloy/blob/098907b76208f786f3070e23c76428d692e94dc3/crates/network/src/transaction/builder.rs#L212-L216

cc @allnil

Additional context

No response

mattsse avatar Apr 06 '24 04:04 mattsse

will take a look

justcode740 avatar Apr 06 '24 04:04 justcode740

thanks @justcode740, you're already assigned to a few other issues. I'll leave this open in case anyone else wants to take this or until you've wrapped up the others :)

mattsse avatar Apr 06 '24 04:04 mattsse

will look at it

allnil avatar Apr 06 '24 13:04 allnil

Hey @allnil, what's the status of this?

onbjerg avatar Apr 29 '24 10:04 onbjerg

@onbjerg hey! going to finish it this week

allnil avatar Apr 29 '24 16:04 allnil

in progress

allnil avatar May 09 '24 14:05 allnil

@allnil update on this?

Rjected avatar May 22 '24 21:05 Rjected

Describe the feature

we now have alloy-signer as dependency, and the EthSigner trait:

https://github.com/paradigmxyz/reth/blob/b89af430e2f45f8a6e53776a6e5150c1b21458c6/crates/rpc/rpc/src/eth/signer.rs#L19-L19

can now be replaced with alloy signer traits (NetworkSigner)

we can also replace all the typedtransaction types:

https://github.com/paradigmxyz/reth/blob/b89af430e2f45f8a6e53776a6e5150c1b21458c6/crates/rpc/rpc-types/src/eth/transaction/typed.rs#L18-L18

in favor of https://github.com/alloy-rs/alloy/blob/098907b76208f786f3070e23c76428d692e94dc3/crates/network/src/transaction/builder.rs#L48-L48 which is implemented for TransactionRequest

https://github.com/alloy-rs/alloy/blob/098907b76208f786f3070e23c76428d692e94dc3/crates/network/src/transaction/builder.rs#L212-L216

cc @allnil

Additional context

No response

Hey @mattsse! Is this issue open to work?

kamuik16 avatar Jul 09 '24 10:07 kamuik16

hey @kamuik16 are you still interested in this?

mattsse avatar Aug 02 '24 12:08 mattsse

yeh, guys, sorry, I don't have capacity to finish it, pretty big issue and I was quite overloaded

allnil avatar Aug 02 '24 12:08 allnil

all good, the draft should be useful for anyone that'll pick this up, ty @allnil

mattsse avatar Aug 02 '24 12:08 mattsse

@mattsse that’s interesting. I’m finishing my last issue and go for this

mvares avatar Aug 07 '24 11:08 mvares

@mattsse, will all components that implement the trait EthSigner possibly be changed?

mvares avatar Aug 07 '24 14:08 mvares

I think we can keep the trait but hide the signing internally like:

https://github.com/alloy-rs/alloy/blob/c3ccf7e2c5f9720fa6c193a9ea918aabf88aa6a2/crates/network/src/transaction/signer.rs#L51-L60

similar to:

https://github.com/paradigmxyz/reth/pull/8614/files#diff-fc791d9a535c846c23e379d9e1656f7c2f5974e06c91da0ce8d89e0322b1696bR1063-R1072

I'm fine with the rlp roundtrip

mattsse avatar Aug 07 '24 18:08 mattsse

I think we can keep the trait but hide the signing internally like:

https://github.com/alloy-rs/alloy/blob/c3ccf7e2c5f9720fa6c193a9ea918aabf88aa6a2/crates/network/src/transaction/signer.rs#L51-L60

similar to:

https://github.com/paradigmxyz/reth/pull/8614/files#diff-fc791d9a535c846c23e379d9e1656f7c2f5974e06c91da0ce8d89e0322b1696bR1063-R1072

I'm fine with the rlp roundtrip

well, what I was wondering:

continue with trait EthSigner and only assigns it with Signer from alloy-signer

cc @mattsse

mvares avatar Aug 07 '24 20:08 mvares

I think we can keep the trait but hide the signing internally like:

https://github.com/alloy-rs/alloy/blob/c3ccf7e2c5f9720fa6c193a9ea918aabf88aa6a2/crates/network/src/transaction/signer.rs#L51-L60

similar to:

https://github.com/paradigmxyz/reth/pull/8614/files#diff-fc791d9a535c846c23e379d9e1656f7c2f5974e06c91da0ce8d89e0322b1696bR1063-R1072

I'm fine with the rlp roundtrip

btw, this makes sense if we keep the trait, maybe could be benefincial for we...

mvares avatar Aug 07 '24 20:08 mvares

marking this as completed per #11089

mattsse avatar Oct 17 '24 11:10 mattsse