brave / brave-browser

Brave browser for Android, iOS, Linux, macOS, Windows.
https://brave.com
Mozilla Public License 2.0
17.53k stars 2.27k forks source link

Remove transactions when the custom network is removed #30234

Open darkdh opened 1 year ago

darkdh commented 1 year ago

When removing custom network, we should also remove its related txs. And we need to do a migration round to remove tx that its chain_id no longer exist if it’s custom network. (This includes removable preloaded netowrks) It’s always been like this since we support custom network, we just weren’t aware of it until refactored GetAllTransactionInfo now supports all tx across chain ids. Besides the API result, those would also occupy the tx storage.

Luckily after multi chain id refactor, each chain id has its own tx limit (before that, they all share one limit). But it still wastes pref spaces for storing that.

StephenHeaps commented 1 year ago

Some additional context: https://bravesoftware.slack.com/archives/C023VS4HJ6Q/p1683648186325759

StephenHeaps commented 6 months ago

Now that brave-ios repo has migrated to brave-core, we can handle iOS at the same time (closing iOS ticket in favour of this one). iOS will have to cleanup this loop: https://github.com/brave/brave-core/blob/93577e109a607f7ba16bd24a7e3fa2a7a5e8eedb/ios/brave-ios/Sources/BraveWallet/Crypto/Stores/TransactionConfirmationStore.swift#L320-L333