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

fix: speed up transaction signing by removing code that does nothing #25302

Merged
merged 1 commit into from
May 18, 2022
Merged

fix: speed up transaction signing by removing code that does nothing #25302

merged 1 commit into from
May 18, 2022

Conversation

steveluscher
Copy link
Contributor

@steveluscher steveluscher commented May 17, 2022

Problem

This _verifySignatures() step runs verification, returns the result of that verification to nobody, and does nothing. We're essentially paying the cost of Message#serialize and Transaction#_verifySignatures and then throwing out the result.

Summary of Changes

  • We've gone 2 years without this code throwing if the result is false or otherwise making use of the result. Let's just get rid of it?

Fixes #24822.

@steveluscher steveluscher requested a review from jstarry May 17, 2022 23:14
@steveluscher steveluscher added the javascript Pull requests that update Javascript code label May 17, 2022
@codecov
Copy link

codecov bot commented May 17, 2022

Codecov Report

Merging #25302 (9664194) into master (69a0ff9) will decrease coverage by 7.0%.
The diff coverage is n/a.

❗ Current head 9664194 differs from pull request most recent head 94b20b6. Consider uploading reports for the commit 94b20b6 to get more accurate results

@@             Coverage Diff             @@
##           master   #25302       +/-   ##
===========================================
- Coverage    82.0%    75.0%     -7.1%     
===========================================
  Files         598       38      -560     
  Lines      165882     2301   -163581     
  Branches        0      335      +335     
===========================================
- Hits       136125     1726   -134399     
+ Misses      29757      459    -29298     
- Partials        0      116      +116     

@steveluscher steveluscher merged commit 84f1e5c into solana-labs:master May 18, 2022
@steveluscher steveluscher deleted the if-a-signature-fails-to-verify-and-nobody-is-there-to-hear-it branch May 18, 2022 18:08
Copy link
Member

@jstarry jstarry left a comment

Choose a reason for hiding this comment

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

Yeah, not sure why this was added, thanks for the cleanup!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
javascript Pull requests that update Javascript code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

web3: unused Tx.verifySignatures
2 participants