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

Eliminate duplicate signature verification of transactions #13140

Open
akhi3030 opened this issue Mar 15, 2025 · 2 comments
Open

Eliminate duplicate signature verification of transactions #13140

akhi3030 opened this issue Mar 15, 2025 · 2 comments
Assignees

Comments

@akhi3030
Copy link
Collaborator

Some time ago we noticed that we are doing unnecessary duplicate signature verification on transactions. In particular, we verify signatures when we receive the tx from the RPC nodes before putting them in the tx pool; and then again when we remove the tx from pool to produce a chunk.

This issue is to track the work to fix this duplicate work.

Our approach will not be to simply disable signature verification when we remove the tx from the pool. This change is risky because a reader might not have a clear picture of when exactly signatures are being verified and we will run the danger of someone accidentally disabling verification on txs before they are inserted in the pool and introducing a huge bug in the protocol.

Instead, we will use the new type idiom to introduce a type ValidatedTransaction that can only be constructed by verifying signatures and the pool will be updated to hold ValidatedTransactions instead. This will provide clear signals to readers that they need to verify signatures before they can insert a tx in the pool and that a tx that they remove from the pool has had its signatures verified. We will also have type safety from the compiler to upload this guarantee.

As this issue is being created after some of the initial work was done, I will recording the various PRs relevant to this work in comments below.

@akhi3030
Copy link
Collaborator Author

Now we are storing ValidatedTransactions in the tx pool and have eliminated the original duplicate signature verification. However, we have [discovered](#general > Unnecessary signature verification? @ 💬) other potential places where duplicate verification is happening and we will continue to use ValidatedTransaction through the code base to eliminate these.

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

No branches or pull requests

1 participant