-
Notifications
You must be signed in to change notification settings - Fork 96
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
multi: add support for enabling/disabling a dex account #2946
Conversation
d2b0482
to
5e1dc4d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utAck just some comments for now. I'm OK with just ignoring the old disabledAccountsBucket
from now on. As far as permanent deletion, it has to occur after all bonds are refunded of course, but yeah, do it in a follow up. We'll need this PR or a minimal version of this PR to go on top of release-v1.0
branch too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good testing fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trying to re-enable the account is resulting in a panic.
@ukane-philemon please look into the panic. I'd like to get this into a patch release asap. |
Sure, I’ll look into it in a moment: |
@buck54321 do you have a trace log? EDIT: Is this what you saw? #3013 |
- Rename AccountDisable to ToggleAccountStatus and allow re-enabling a disabled account. Signed-off-by: Philemon Ukane <[email protected]>
Signed-off-by: Philemon Ukane <[email protected]>
Signed-off-by: Philemon Ukane <[email protected]>
Signed-off-by: Philemon Ukane <[email protected]>
Signed-off-by: Philemon Ukane <[email protected]>
Signed-off-by: Philemon Ukane <[email protected]>
Signed-off-by: Philemon Ukane <[email protected]>
8f8ccdc
to
bda10a3
Compare
Screen.Recording.2024-10-10.at.2.30.53.AM.movTested again, and noticed no panic concerning this. The only unrelated panic I got is #3013 and I'm unable to reproduce it. |
This first one simulates what we might encounter if a server goes offline permanently or just happens to be offline when we try to re-enable it. This results in a panic.
This other one is just something I stumbled across.
|
Signed-off-by: Philemon Ukane <[email protected]>
Signed-off-by: Philemon Ukane <[email protected]>
Both issues have been resolved in separate commits. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just for convenience, here's the changes I think are needed buck54321/dcrdex@c9bf340...buck54321:dcrdex:toggle-account-fixes
client/core/core.go
Outdated
if initialized, _ := dc.acct.status(); !initialized { | ||
return // dex account is not yet initialized, so we can't unlock it. | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't necessary. The problem you had before was that you were using connectDEX
in ToggleAccountStatus
, and connectDEX
doesn't set the connectDEXFlag
so dc.acct.viewOnly
was not being set correctly. Now that you're using connectAccount
, this isn't a problem.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I traced your last error report to this: dc.acct.encKey was not set hence the error, which means it hasn't been initialized and this was an attempt to fix that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please read again and look at the code. Nothing I said was incorrect. Your use of connectDEX
, which doesn't set the connectDEXFlag
correctly, was the problem.
Thanks, cherry-picked as is. |
* multi: update AccountDisable method on core and db - Rename AccountDisable to ToggleAccountStatus and allow re-enabling a disabled account. --------- Signed-off-by: Philemon Ukane <[email protected]> Co-authored-by: Brian Stafford <[email protected]>
Closes #2943
This PR introduces a new behaviour for disabled dex accounts. The account is no longer deleted and will be loaded into memory when core is initialized as an inactive dexConnection to facilitate active bond refunds(if any) every bond rotation. Users can now disable an account with active unspent bonds if they wish to.
Screen.Recording.2024-09-04.at.10.07.53.AM.mov
disabledAccountsBucket
was removed. This means previously disabled accounts are lost. If we intend to allow users to re-enable a previously disabled account without having to add it again, I would restoredisabledAccountsBucket
and allow for backward compatibility.As a follow up, I'll implement an endpoint to support deleting a dex server from the db. @buck54321 what do you think?