You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.
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 holdValidatedTransaction
s 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.
The text was updated successfully, but these errors were encountered: