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

Optimise translating the Byron UTxO to the Shelley UTxO #2464

Merged
merged 1 commit into from
Jul 24, 2020

Conversation

mrBliss
Copy link
Contributor

@mrBliss mrBliss commented Jul 24, 2020

Instead of going from compact Byron Tx -> normal Byron Tx -> normal Shelley Tx
-> compact Shelley Tx, go from compact Byron Tx -> compact Shelley Tx.

The crux is to avoid deserialising and reserialising the address in the TxOut.

I measured the time it took to translate the Byron ledger to the Shelley ledger
when syncing mainnet_candidate2:

Before: 3.7s
After: 1.2s

@mrBliss mrBliss added the consensus issues related to ouroboros-consensus label Jul 24, 2020
@mrBliss mrBliss requested review from edsko and dcoutts July 24, 2020 09:49
@mrBliss
Copy link
Contributor Author

mrBliss commented Jul 24, 2020

Still a draft until IntersectMBO/cardano-ledger#1708 has been merged.

UPDATE: merged

@mrBliss mrBliss force-pushed the mrBliss/optimise-utxo-translation branch from 0e68788 to 1fd28cc Compare July 24, 2020 13:21
@mrBliss mrBliss marked this pull request as ready for review July 24, 2020 13:22
Copy link
Contributor

@edsko edsko left a comment

Choose a reason for hiding this comment

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

Nice, happy you added a property :)

Instead of going from compact Byron Tx -> normal Byron Tx -> normal Shelley Tx
-> compact Shelley Tx, go from compact Byron Tx -> compact Shelley Tx.

The crux is to avoid deserialising and reserialising the address in the `TxOut`.

I measured the time it took to translate the Byron ledger to the Shelley ledger
when syncing mainnet_candidate2:

Before: 3.7s
After:  1.2s
@mrBliss mrBliss force-pushed the mrBliss/optimise-utxo-translation branch from 1fd28cc to fa13c2d Compare July 24, 2020 13:59
@mrBliss
Copy link
Contributor Author

mrBliss commented Jul 24, 2020

bors merge

@iohk-bors
Copy link
Contributor

iohk-bors bot commented Jul 24, 2020

@iohk-bors iohk-bors bot merged commit f1c0946 into master Jul 24, 2020
@iohk-bors iohk-bors bot deleted the mrBliss/optimise-utxo-translation branch July 24, 2020 14:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
consensus issues related to ouroboros-consensus
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants