Try random server for new wallets and when restoring from seedphrase #116

Closed
opened 1 year ago by duke · 9 comments
duke commented 1 year ago
Owner

Currently most places in the code will try random servers if the first server tried is down, but that code was never added for when the wallet is initially created or when restoring from seedphrase.

Currently most places in the code will try random servers if the first server tried is down, but that code was never added for when the wallet is initially created or when restoring from seedphrase.
duke added the
high priority
label 1 year ago
duke commented 1 year ago
Poster
Owner

Latest commit on dev branch 3f8ae1f9d7 attempts to fix this for new wallets. Needs testing.

Latest commit on dev branch https://git.hush.is/hush/SilentDragonLite/commit/3f8ae1f9d75766331e3d1bb7689e7b18850061e1 attempts to fix this for new wallets. Needs testing.
fekt commented 1 year ago
Collaborator

This seems to be working for creating a new wallet and I think the same code only needs to be added for when restoring a seedphrase in RestoreSeedPage::validatePage(). I had a hostname set that doesn't exist and it created a new wallet fine. The only quirk I noticed is that it didn't update the server in registry or settings (probably don't want to make it sticky) and info tab still shows the wrong server so you don't know what server you're actually connected to. My guess is the info tab pulls the setting value.

Since this isn't in restore function, when restoring on Windoze, I still get the infamous Unexpected compression flag when using lite.hush.is.

If I try restoring with a hostname that doesn't exist, I get a different error Couldn't restore the wallet and Error: No such host is known. (os error 11001)

This seems to be working for creating a new wallet and I think the same code only needs to be added for when restoring a seedphrase in `RestoreSeedPage::validatePage()`. I had a hostname set that doesn't exist and it created a new wallet fine. The only quirk I noticed is that it didn't update the server in registry or settings (probably don't want to make it sticky) and info tab still shows the wrong server so you don't know what server you're actually connected to. My guess is the info tab pulls the setting value. Since this isn't in restore function, when restoring on Windoze, I still get the infamous `Unexpected compression flag` when using lite.hush.is. If I try restoring with a hostname that doesn't exist, I get a different error `Couldn't restore the wallet` and `Error: No such host is known. (os error 11001)`
duke commented 1 year ago
Poster
Owner

Latest code should now try another server in all circumstances

Latest code should now try another server in all circumstances
fekt commented 1 year ago
Collaborator

Seems to be working when restoring from a seedphrase now but there's no sync status and only says "The Dragon Awakens...". I think that's another known bug I recall seeing awhile back but will need to check if there's an issue for it.

Edit:
It is the same or similar issue as this in SD: hush/SilentDragon#87

Seems to be working when restoring from a seedphrase now but there's no sync status and only says "The Dragon Awakens...". I think that's another known bug I recall seeing awhile back but will need to check if there's an issue for it. Edit: It is the same or similar issue as this in SD: https://git.hush.is/hush/SilentDragon/issues/87
Collaborator

Latest code should now try another server in all circumstances

What does it mean? I see connections to all servers at the same time, I just confirmed with servers I run and see connections to all of them in the same time range.

> Latest code should now try another server in all circumstances What does it mean? I see connections to all servers at the same time, I just confirmed with servers I run and see connections to all of them in the same time range.
fekt commented 1 year ago
Collaborator

What does it mean? I see connections to all servers at the same time, I just confirmed with servers I run and see connections to all of them in the same time range.

It should only try another server when a server is down. I am seeing connections to multiple servers at the same time repeatedly too and it seems to cause SDL to hang and/or crash.

> What does it mean? I see connections to all servers at the same time, I just confirmed with servers I run and see connections to all of them in the same time range. It should only try another server when a server is down. I am seeing connections to multiple servers at the same time repeatedly too and it seems to cause SDL to hang and/or crash.
duke commented 1 year ago
Poster
Owner

@fekt my code incorrectly looked for "OK" in the response instead of a non-empty response in a few places, hopefully latest commits fix this

@fekt my code incorrectly looked for "OK" in the response instead of a non-empty response in a few places, hopefully latest commits fix this
fekt commented 1 year ago
Collaborator

@duke latest commit seems good and not flooding multiple servers 👍

@duke latest commit seems good and not flooding multiple servers 👍
duke commented 1 year ago
Poster
Owner

ok, closing this. Open new issues for other specific bugs

ok, closing this. Open new issues for other specific bugs
duke closed this issue 1 year ago
Sign in to join this conversation.
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
There is no content yet.