-
Notifications
You must be signed in to change notification settings - Fork 249
CW-974: Add support for automatic node switching. #2361
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
Conversation
This change: - Adds isTrustedNodeForSwitching property to Node class. - Adds UI Checkbox to mark a node as trusted for automatic switching in Node create or edit form. - Implements checkNodeHealth method in wallet classes to verify node connectivity. - Adds NodeSwitchingService for managing automatic node switching based on health checks. - Adds setting option for user to enable/disable automated node switching
…es in NodeSwitchingService
This change: - Moves enable automatic node switch to the Manage Nodes Page - Adds check to verify node health before attempting to sync in EVM, Sol and Tron Wallets. - Modifies trusted ndoes list for monero - Adds trigger for Node Health Check when app resumes from background
…k interval for node switch
This change adds additional checks for token balance in EVM, Solana and Tron Wallets in checkNodeHealth.
…Allow-Automatic-Node-Switching
…ake-tech/cake_wallet into Allow-Automatic-Node-Switching
…Allow-Automatic-Node-Switching
This change: - Enables more nodes across wallet types for auto switching - Modifies CTA for checkbox - Renames flags to fit
…Allow-Automatic-Node-Switching
value: nodeViewModel.isTrustedNodeForSwitching, | ||
borderColor: Theme.of(context).colorScheme.surfaceContainerHighest, | ||
iconColor: Theme.of(context).colorScheme.primary, | ||
onChanged: (value) => nodeViewModel.isTrustedNodeForSwitching = value, |
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.
better use the setter as well and make the variable private
cw_evm/lib/evm_chain_wallet.dart
Outdated
@@ -828,6 +858,7 @@ abstract class EVMChainWalletBase | |||
_transactionsUpdateTimer = Timer.periodic(const Duration(seconds: 15), (_) { | |||
_updateTransactions(); | |||
_updateBalance(); | |||
_updateEstimatedGasFeeParams(); |
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.
previously it was called every 30 seconds, which I believe is sufficient for this function, now that I see our daily usage, I believe we should check which functions needs to be called frequently and which should be called less frequently so we can decide better and put periodic time accordingly
break; | ||
break; | ||
case 50: | ||
await migrateExistingNodesToUseAutoSwitching(nodes: nodes); |
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 can be async, no need to be awaited
await migrateExistingNodesToUseAutoSwitching(nodes: nodes); | |
migrateExistingNodesToUseAutoSwitching(nodes: nodes); |
…Allow-Automatic-Node-Switching
Issue Number (if Applicable): Fixes #
Description
This change:
Pull Request - Checklist