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: use OnceCell for Signed::hash #2025

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

feat: use OnceCell for Signed::hash #2025

wants to merge 1 commit into from

Conversation

klkvr
Copy link
Member

@klkvr klkvr commented Feb 7, 2025

Motivation

closes #1987

Lazily computes hash for the transaction in Signed. Methods relying on hash are now bounded by T: RlpEcdsaTx which works for all of the transactions we have but would likely get trickier for custom signature usecases

Solution

PR Checklist

  • Added Tests
  • Added Documentation
  • Breaking changes

@klkvr klkvr marked this pull request as draft February 7, 2025 13:57
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.

I like this,

we should make it very clear that this Signed type is specifically for transactions, it's already mentioned but I think we can make this even clearer

@klkvr klkvr marked this pull request as ready for review February 7, 2025 14:11
@DaniPopes
Copy link
Member

Why can't we use std here?

@klkvr
Copy link
Member Author

klkvr commented Feb 7, 2025

we can but we'd still need once_cell in no-std

@mattsse
Copy link
Member

mattsse commented Feb 7, 2025

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.

[Feature] Use lazy hashing for Signed
3 participants