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

fix: delete of account via RPC throws while node account rescan is active #4867

Merged
merged 1 commit into from Apr 3, 2024

Conversation

jowparks
Copy link
Contributor

@jowparks jowparks commented Apr 3, 2024

tl;dr: when called delete account on a node that is rescanning, head is deleted for the account before it is deleted from in memory store of wallet.accounts.

Problem

RPC Client - delete account sent to remote node. Occasionally, node will crash saying head isn't set.

RCA:

Order of events that cause failure:

  1. Client: Account import requested
  2. Node: Imports account, rescan initiated
  3. Client: Account delete requested
  4. Node: Head is deleted here, but subsequent code line this.accounts.delete(account.id) is not yet called.
  5. Node: New block connect is called, wallet.accounts still contains account created from step 1/2.

Testing Plan

Manual testing, difficult to reproduce.

Documentation

Does this change require any updates to the Iron Fish Docs (ex. the RPC API
Reference
)? If yes, link a
related documentation pull request for the website.

[ ] Yes

Breaking Change

Is this a breaking change? If yes, add notes below on why this is breaking and label it with breaking-change-rpc or breaking-change-sdk.

[ ] Yes

@jowparks jowparks requested a review from a team as a code owner April 3, 2024 16:07
@jowparks jowparks force-pushed the fix-rescanning-account-crash-delete branch from 824b3f1 to 72684f6 Compare April 3, 2024 16:08
…ror was that in memory store still contained account for a moment while the head was deleted.
@jowparks jowparks force-pushed the fix-rescanning-account-crash-delete branch from 72684f6 to 8dbe40a Compare April 3, 2024 16:09
@jowparks jowparks merged commit a34552c into staging Apr 3, 2024
10 checks passed
@jowparks jowparks deleted the fix-rescanning-account-crash-delete branch April 3, 2024 17:24
@jowparks jowparks changed the title fix: rescanning account crash delete fix: delete of account via RPC throws while node account rescan is active Apr 3, 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

2 participants