status-go: MultiAccountStoreDerived reports account already exists while RPC API doesn't
Problem
The original problem was reported at https://github.com/status-im/status-react/issues/10326 but it seems to boil down to misbehaviour in status-go.
As described in this https://github.com/status-im/status-react/issues/10326#issuecomment-615146351 adding multiaccounts (watch only) and removing them again, seems to not properly remove them from status-go cache.
While the RPC API accounts_getAccount properly returns the latest state with only the main multiaccount and the chat account being available, MultiAccountStoreDerived still emits an error that the account in question 'already exists'.
I assume https://github.com/status-im/status-go/issues/1896 and https://github.com/status-im/go-ethereum/pull/87 are related to this.
Happy to help debugging/verifying this on status-go’ side. Any pointers to make that happen are highly appreciated 😃
Implementation
Need to verify if this is really the case or of there’s something else off. Skimming through the code it looks like status-go is returning accounts from cache, so there might be an issue with accounts not being properly removed from cache.
As a matter of fact, while adding a new multi account calls into native status-go inside status-react here: https://github.com/status-im/status-react/blob/a79a72fccb27911b0caf96534a52215ba162d92b/src/status_im/native_module/core.cljs#L133-L137
and therefore here:
It doesn’t look like the same is happening with the account deletion:
Instead it’s going through the RPC API. Maybe that is bypassing the cache?
Just thinking out loud here, hope this is useful information.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 17 (17 by maintainers)
Commits related to this issue
- fix(wallet/accounts): don't store derived account when it exists in app db As discussed in #10326 and later in https://github.com/status-im/status-go/issues/1939, it turns out that, when a user tries... — committed to 0x-r4bbit/status-react by 0x-r4bbit 4 years ago
- fix(wallet/accounts): don't store derived account when it exists in app db As discussed in #10326 and later in https://github.com/status-im/status-go/issues/1939, it turns out that, when a user tries... — committed to 0x-r4bbit/status-react by 0x-r4bbit 4 years ago
- fix(wallet/accounts): don't store derived account when it exists in app db As discussed in #10326 and later in https://github.com/status-im/status-go/issues/1939, it turns out that, when a user tries... — committed to 0x-r4bbit/status-react by 0x-r4bbit 4 years ago
yeah I think the final fix would be for status-react to validate the uniqueness of an address before generating and storing the key in the filesystem.
On Tue, Apr 21, 2020, 19:27 flexsurfer notifications@github.com wrote: