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

feat: expose Signature<T> #689

Closed
wants to merge 7 commits into from
Closed

Conversation

leruaa
Copy link
Contributor

@leruaa leruaa commented Jul 19, 2024

Motivation

Needed for alloy-rs/alloy#1077 and paradigmxyz/reth#9593

Solution

PR Checklist

  • Added Tests
  • Added Documentation
  • Breaking changes

@leruaa leruaa marked this pull request as draft July 21, 2024 18:51
@leruaa
Copy link
Contributor Author

leruaa commented Jul 21, 2024

While attempting to apply this refactoring to alloy itself, I start to understand why the k256 feature is not additive. That to avoid to impl traits like SignableTransaction for multiple Signature types leading to the "multiple impls ... found" error.

I'm trying to find a workaround.

@mattsse
Copy link
Member

mattsse commented Jul 22, 2024

@leruaa perhaps we can introduce a helper trait in alloy for the required rsv function and just that for the alloy encode signature fns instead?

Copy link
Member

@mattsse mattsse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this would introduce a ton of friction

I agree the memoized type is a bit horribly, but we can probably solve our problems alloy internally by introducing a signature encodeable trait there so we can implement it for reth's signature type as well.
can deal with the generic signature snafu later

@mattsse
Copy link
Member

mattsse commented Jul 23, 2024

but perhaps we should consider removing the generic entirely, I find this very useless because this is effectively just duplicating the rsv again

/// Returns the inner ECDSA signature.
#[inline]
pub const fn inner(&self) -> &S {
&self.inner
}

@leruaa
Copy link
Contributor Author

leruaa commented Jul 23, 2024

@mattsse fyi and for posterity, the branch in alloy applying this refactoring in alloy-core: alloy-rs/alloy@main...leruaa:alloy:signature_refactoring

@leruaa leruaa mentioned this pull request Jul 24, 2024
3 tasks
@leruaa leruaa closed this Jul 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants