Page MenuHomePhabricator

[electrum] regenerate protobuf files
ClosedPublic

Authored by PiRK on Sep 2 2024, 14:33.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Commits
rABC28620bdc2b3c: [electrum] regenerate protobuf files
Summary

Update the protobuf files in the newer format supported by protobuf versions > 4. This makes it possible for users with a newer version of protobuf installed to use Electrum ABC.

For now we keep protobuf 3.20 as the official requirement, because this is the only version supporting both the old and new protobuf format. Our dependency to keepkey makes it hard to drop support for the old format (see description of the issue here: https://github.com/spesmilo/electrum/issues/7922)

There is ongoing work for trying to make keepkey work with the new protobuf format, but for now I have not been able to use it succesfully. See https://github.com/keepkey/python-keepkey/issues/146

Note that I generated the files with protobuf 5.28 and then manually removed the runtime version check which is not supported by protobuf 3.20

diff --git a/electrum/electrumabc_plugins/fusion/fusion_pb2.py b/electrum/electrumabc_plugins/fusion/fusion_pb2.py
index 317bb6e3d5..bc58f947fd 100644
--- a/electrum/electrumabc_plugins/fusion/fusion_pb2.py
+++ b/electrum/electrumabc_plugins/fusion/fusion_pb2.py
@@ -1,11 +1,22 @@
 # -*- coding: utf-8 -*-
 # Generated by the protocol buffer compiler.  DO NOT EDIT!
-# NO CHECKED-IN PROTOBUF GENCODE
 # source: fusion.proto
-# Protobuf Python Version: 5.28.0
 """Generated protocol buffer code."""
 from google.protobuf import descriptor as _descriptor
 from google.protobuf import descriptor_pool as _descriptor_pool
-from google.protobuf import runtime_version as _runtime_version
 from google.protobuf import symbol_database as _symbol_database
 from google.protobuf.internal import builder as _builder
-_runtime_version.ValidateProtobufRuntimeVersion(
-    _runtime_version.Domain.PUBLIC,
-    5,
-    28,
-    0,
-    '',
-    'fusion.proto'
-)
 # @@protoc_insertion_point(imports)

 _sym_db = _symbol_database.Default()

I compared the generated paymentrequest file with the one electrum uses and did not find any other discrepancy that could cause an issue with protobuf 3.20

Test Plan

python test_runner.py

Wait for a successfull fusion.

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

PiRK requested review of this revision.Sep 2 2024, 14:33
This revision is now accepted and ready to land.Sep 2 2024, 16:33
This revision was automatically updated to reflect the committed changes.