Skip to content
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

accounts: properly close account manager and usb wallets #28710

Merged
merged 1 commit into from
Dec 20, 2023

Conversation

holiman
Copy link
Contributor

@holiman holiman commented Dec 20, 2023

I noticed, when interacting both via geth and clef, that shutting down the process and trying to work with usb hardware wallets again, most often failed. I had to unplug the device and plug it back again for it to work.

It turns out that the account manager did not call Close on the wallets that it was managing.
Further, clef did not even bother to close the account manager.

This PR fixes both problems.

Copy link
Member

@MariusVanDerWijden MariusVanDerWijden left a comment

Choose a reason for hiding this comment

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

LGTM, the double checking of w.device looked odd to me, but I convinced myself that it is actually needed since the status might change between the moment we hold the read lock and the write lock

@fjl fjl merged commit d3452a2 into ethereum:master Dec 20, 2023
1 of 3 checks passed
@fjl fjl added this to the 1.13.8 milestone Dec 20, 2023
@fjl fjl changed the title accounts/manager: properly close account manager and usb wallets accounts: properly close account manager and usb wallets Dec 20, 2023
@holiman
Copy link
Contributor Author

holiman commented Dec 20, 2023

LGTM, the double checking of w.device looked odd to me, but I convinced myself that it is actually needed since the status might change between the moment we hold the read lock and the write lock

I wish I could say that I just "saw" that it was needed, but no, I ran into a nil deref first time around, so yeah it was needed :)

Dergarcon pushed a commit to specialmechanisms/mev-geth-0x2mev that referenced this pull request Jan 31, 2024
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.

None yet

3 participants