-
Notifications
You must be signed in to change notification settings - Fork 151
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
Zeroize txs bench #2932
Draft
cbeck88
wants to merge
13
commits into
main
Choose a base branch
from
zeroize-txs-bench
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Zeroize txs bench #2932
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Also makes transaction builder able to generate the tx summary unblinding data. This fills out the functionality of MCIP 52. --- The `TxSummaryUnblindingData`, together with the `TxSummary`, can be used to verify what is happening in the transaction according to the `TxSummary`. The `TxSummaryVerifier` takes the extended message digest, and the `TxSummary` and `TxSummaryUnblindingData` in a streaming fashion. Then it produces the verified `TxSummaryReport` which lists which entities observe which balance changes as a result of the transaction, as well as the fee and tombstone block of the transaction. This process also produces the digest which Ring MLSAG are supposed to sign. Some tests are added which confirm that this checking and verification is working, and that serialization is working. --- This PR has a small impact on the `UnsignedTx` object and associated protouf, but it is not very difficult for downstream to adapt to that.
Co-authored-by: Eran Rundstein <eran@rundste.in>
This is an experimental change to improve hygeine of memory in the consensus enclave (but also in the clients) This makes a bunch of objects derive `Zeroize` in transaction-core, and makes the `Tx` object zeroize itself on drop. For examples of why this is a good change, consider that, in the `mc-connection` ThickClient crate, after we serialize a Tx to protobuf and encrypt it for the enclave, we zeroize the plaintext. However, before this change, we do not zeroize the `Tx` object (since it would not have been possible), so another copy of the data that we zeroized continues to exist in memory. After this change, the `Tx` will zeroize itself automatically as well. The main reason not to do this would be if it hurts the performance of the consensus nodes, but I consider this unlikely, because, the untrusted side never actually sees `Tx` objects so SCP should not be meaningfully impacted by this, only the transaction validation handles the decrypted `Tx`. And the elliptic curve operations done to validate a Tx should be many orders of magnitude more expensive than a zeroizing operation. So I expect no measurable performance difference as a result of this change. See github issue #2717
Locally my results are:
|
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add a benchmark for zeroizing a max-size Tx
(Actually, this clones and then drops a max-size Tx, with the ZeroizeOnDrop commit)