Skip to content

feat: Stateless validation function receives public keys corresponding to each transaction#17841

Merged
mattsse merged 16 commits intoparadigmxyz:mainfrom
kevaundray:kw/wolfgang-optimization-ecrecover
Oct 16, 2025
Merged

feat: Stateless validation function receives public keys corresponding to each transaction#17841
mattsse merged 16 commits intoparadigmxyz:mainfrom
kevaundray:kw/wolfgang-optimization-ecrecover

Conversation

@kevaundray
Copy link
Copy Markdown
Contributor

Taken and modified from: https://github.com/risc0/zeth/compare/wollac/wip/pre-recover

This PR changes the interface to use block and public keys, allowing the host to recover the public keys outside of the guest and do signature verification inside of the guest

Co-authored-by: Wolfgang Welz <welzwo@gmail.com>
@github-actions github-actions bot added the S-stale This issue/PR is stale and will close with no further activity label Sep 4, 2025
@github-actions github-actions bot closed this Sep 11, 2025
@github-project-automation github-project-automation bot moved this from Backlog to Done in Reth Tracker Sep 11, 2025
@kevaundray
Copy link
Copy Markdown
Contributor Author

@mattsse bump on this

@mattsse mattsse reopened this Sep 15, 2025
@github-project-automation github-project-automation bot moved this from Done to In Progress in Reth Tracker Sep 15, 2025
@mattsse mattsse added C-enhancement New feature or request M-prevent-stale Prevents old inactive issues/PRs from being closed due to inactivity and removed S-stale This issue/PR is stale and will close with no further activity labels Sep 15, 2025
Copy link
Copy Markdown
Collaborator

@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.

some thoughts on trait support for recovery, but I'm also okay with proceeding with this

@kevaundray kevaundray force-pushed the kw/wolfgang-optimization-ecrecover branch from dbcb34a to 706de6a Compare September 18, 2025 00:07
@kevaundray kevaundray force-pushed the kw/wolfgang-optimization-ecrecover branch from a92ff86 to e475deb Compare September 18, 2025 01:58
@kevaundray
Copy link
Copy Markdown
Contributor Author

@mattsse public key type is no longer exposed in the interface and added feature flags for the two secp256k1 crates -- feature flags are a bit complex because the CI checks for --no-default-features and --all-features, will check it again in the morning to clean up

Comment on lines +47 to +52
/// Verifies a transaction using its signature and the given public key.
///
/// Note: If the signature or the public key is incorrect, then this method
/// will return an error.
///
/// Returns the address derived from the public key.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This function and the ones below it could be placed into alloy next to recover_signer

@kevaundray
Copy link
Copy Markdown
Contributor Author

@mattsse bump on this

Copy link
Copy Markdown
Collaborator

@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.

fine with me,

left one more q

let _: B256 = sig_hash;
let _: &Signature = sig;

unimplemented!("Must choose either k256 or secp256k1 feature")
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

should this even result in a compile_error! ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Tried to go with the suggested cleaner route, though it means that all methods called by this method would have a cfg(any(secp256k1 || k256)) too -- I may be missing something re making this cleaner without leaking it to all of the methods that call it

@kevaundray kevaundray force-pushed the kw/wolfgang-optimization-ecrecover branch 2 times, most recently from 37c0757 to e18d8f0 Compare October 15, 2025 22:41
@mattsse mattsse added this pull request to the merge queue Oct 16, 2025
Merged via the queue into paradigmxyz:main with commit be648d9 Oct 16, 2025
41 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in Reth Tracker Oct 16, 2025
emhane pushed a commit to op-rs/op-reth that referenced this pull request Oct 20, 2025
…g to each transaction (paradigmxyz#17841)

Co-authored-by: Wolfgang Welz <welzwo@gmail.com>
emhane pushed a commit to op-rs/op-reth that referenced this pull request Oct 20, 2025
…g to each transaction (paradigmxyz#17841)

Co-authored-by: Wolfgang Welz <welzwo@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-enhancement New feature or request M-prevent-stale Prevents old inactive issues/PRs from being closed due to inactivity

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants