Page MenuHomePhabricator

[electrum] store and serialize tx data as bytes
ClosedPublic

Authored by PiRK on Sep 22 2023, 13:00.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Commits
rABC0c195f354aa5: [electrum] store and serialize tx data as bytes
Summary

This should reduce the memory usage of the application by dividing the size of unserialized transactions by 2, and saves a bytes.fromhex(..) conversion in the deserialization function.
The bytes.fromhex conversion now happens at the I/O layer (opening wallet files, receiving transactions from the network, copy-pasting unsigned hex transactions), where the conversion cost probably does not make a difference as the process is I/O bound.

Depends on D14525

Test Plan

python test_runner.py

./electrum-abc deserialize 02000000012367ad0da9fb8f8a7e574d55d4eb2dd0fd8ebd58b1c21cfddb9fe5426369082a000000006441761c8b702e06fcb8656cb205454f22efff174e3ae9552c1ee83f7d64e3b0d29fa466c48a82597713fd7a3c03e324855349a76660fa26dfec4922c51ea0f51cb6412102a42cd220e6099d5d678066b81813ae4fdd14b290479962ae5c0af1448113bcb4feffffff030000000000000000066a047370616d05b20100000000001976a9144fe822f96257d66eeb498394ce9a1fbca1323ba088ac10270000000000001976a914b97b77f0a2e0b3161354de723a76d58a974c601988ac00000000

Diff Detail

Event Timeline

PiRK edited the summary of this revision. (Show Details)

rebase ont D14525

remove low-priority and low impact todos

remove wrong typehint
In this module the types are defined in arg_types

electrum/electrumabc_plugins/digitalbitbox/digitalbitbox.py
673–675 ↗(On Diff #42348)

I'm not fixing it in this diff because it is not exactly related, and I'm not sure how to test this, and I'm not sure I want to keep this code around.

PiRK published this revision for review.Sep 22 2023, 14:58
This revision is now accepted and ready to land.Sep 25 2023, 08:35