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

Update txid in fromHex #313

Merged
merged 3 commits into from
Mar 10, 2024
Merged

Conversation

Duddino
Copy link
Member

@Duddino Duddino commented Mar 5, 2024

Abstract

MPW was spending a lot of time serializing the transaction when calculating the txid.
To prevent this, we can calculate the txid during the serialization, when we have the hex.

This is the benchmark before the PR, on a very big testnet wallet:
image

This is after:
image

Testing

Test that the general functionality works

Copy link

netlify bot commented Mar 5, 2024

Deploy Preview for cheery-moxie-4f1121 ready!

Name Link
🔨 Latest commit da03c23
🔍 Latest deploy log https://app.netlify.com/sites/cheery-moxie-4f1121/deploys/65e9fb34dad5100008ca2ec0
😎 Deploy Preview https://deploy-preview-313--cheery-moxie-4f1121.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Member

@panleone panleone left a comment

Choose a reason for hiding this comment

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

nice improvement, just one nit

@@ -94,6 +94,7 @@ export class Transaction {
shieldSpend = [],
shieldOutput = [],
bindingSig = '',
txid,
Copy link
Member

Choose a reason for hiding this comment

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

unused parameter in the constructor

@@ -105,11 +106,14 @@ export class Transaction {
this.shieldOutput = shieldOutput;
this.bindingSig = bindingSig;
this.valueBalance = valueBalance;
this.#txid = txid;
Copy link
Member

Choose a reason for hiding this comment

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

and here too

@panleone panleone added the Enhancement New feature or request label Mar 6, 2024
Copy link
Member

@JSKitty JSKitty left a comment

Choose a reason for hiding this comment

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

tACK da03c23

I've been comparing with multiple tests against master and getting consistent improvements, my wallet is far smaller than yours so the magnitude is much less (about a 10% speed increase) but definitely noticeable in the performance captures.

@panleone panleone merged commit 3f4743a into PIVX-Labs:master Mar 10, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants