Skip to content

Conversation

f321x
Copy link
Member

@f321x f321x commented May 20, 2025

Implements release channels so the user can select either a stable or beta release channel in the SettingsDialog for update notifications.
Adapts the release_www.sh and make_download scripts to handle alpha and beta versions which are detected by an 'a' or 'b' in the version name.
The version fields are added into the extradata field of the version file as version_alpha and version_beta and the extradata field is being signed too in the extradata_hash_signature field.
The update checker is supposed to return the newest version of those contained in the version file which is
allowed according to the user configured option.

@f321x f321x force-pushed the release_channel branch from 065c0ee to d613a5d Compare May 21, 2025 11:46
@f321x f321x force-pushed the release_channel branch 2 times, most recently from da14ab3 to 8eff7e1 Compare May 21, 2025 14:56
@f321x f321x changed the title wip: implement release channels implement release channels May 21, 2025
@f321x f321x force-pushed the release_channel branch 2 times, most recently from 633b270 to 5260b32 Compare May 21, 2025 15:39
@f321x f321x marked this pull request as ready for review May 21, 2025 15:45
@f321x f321x force-pushed the release_channel branch from 5260b32 to 4703bd5 Compare May 22, 2025 08:08
}, sort_keys=True, separators=(',', ':')))" "$ANDROID_VERSIONCODE_NULLARCH" "$VERSION_ALPHA" "$VERSION_BETA")

# signing the hash of extradata instead of passing extradata directly,
# so it doesn't get parsed as dict when passing it into signmessage,
Copy link
Member

@SomberNight SomberNight May 22, 2025

Choose a reason for hiding this comment

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

I started looking into this but it is turning into quite a rabbit hole...
The root cause is here:

electrum/run_electrum

Lines 247 to 249 in 9b24316

# decode json arguments
if cmdname not in ('setconfig',):
args = list(map(json_decode, args))

I would say it's a bug that e.g. $ ./run_electrum -v --testnet -w ~/.electrum/testnet/wallets/9dk -o signmessage tb1qq2tmmcngng78nllq2pvrkchcdukemtj5s6l0zu "5" does not work, due to the message getting json-decoded to an int.
Anyway, I am still looking into this.

Copy link
Member

@ecdsa ecdsa Aug 4, 2025

Choose a reason for hiding this comment

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

maybe these 3 lines can be deleted? if something needs to be converted to json, it will be done in parser.parse_args. Example: The following command works after deleting these 3 lines

@@ -256,9 +256,6 @@ async def run_offline_command(config: 'SimpleConfig', config_options: dict, wall
         print_msg("Warning: running command offline")
     # arguments passed to function
     args = [config.get(x) for x in cmd.params]
-    # decode json arguments
-    if cmdname not in ('setconfig',):
-        args = list(map(json_decode, args))
     # options
     kwargs = {}
     for x in cmd.options:
/run_electrum --testnet -o serialize '{                                                                                                                                                     
            "inputs": [                                                                                                                                                                        
                {"prevout_hash": "9d221a69ca3997cbeaf5624d723e7dc5f829b1023078c177d37bdae95f37c539", "prevout_n": 1,                                                                           
                 "value_sats": 1000000, "privkey": "p2wpkh:cVDXzzQg6RoCTfiKpe8MBvmm5d5cJc6JLuFApsFDKwWa6F5TVHpD"}                                                                              
            ],                                                                                                                                                                                 
            "outputs": [                                                                                                                                                                       
                {"address": "tb1q4s8z6g5jqzllkgt8a4har94wl8tg0k9m8kv5zd", "value_sats": 990000}                                                                                                
            ]                                                                                                                                                                                  
        }'

Copy link
Member

Choose a reason for hiding this comment

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

ah, I forgot that this will not work with curl/jsonrpc

Copy link
Member

Choose a reason for hiding this comment

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

yes, it's not so simple. (1) jsonrpc vs (2) online CLI vs (3) offline CLI all work very subtly different. We need explicit unit tests, as otherwise the whole thing is extremely fragile.
I have some WIP changes from when I last commented above:
SomberNight@ef57336

implements release channels so the user can select either a stable or
beta release channel in the SettingsDialog for update notifications.
adapts the release_www.sh and make_download scripts to handle alpha
and beta versions which are detected by an 'a' or 'b' in the version name.
the version fields are added into the extradata field of the version file as
'version_alpha' and 'version_beta' and the extradata field is now being signed.
The update checker is supposed to return the newest version of those
contained in the version file which is
allowed according to the user configured option.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants