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

Optimize the setting of sync start block in light client mode #304

Open
Danie0918 opened this issue Oct 20, 2023 · 13 comments
Open

Optimize the setting of sync start block in light client mode #304

Danie0918 opened this issue Oct 20, 2023 · 13 comments
Assignees
Labels
enhancement New feature or request

Comments

@Danie0918
Copy link
Contributor

Danie0918 commented Oct 20, 2023

image
image

In the current light client mode, the user can set the synchronization start block. When the block number set by the user is after the historical transaction block number, then the historical transaction will not be synchronized, but displaying 100% synchronization can be misleading to the user.

This needs to be optimized:

1.Add a strong hint when setting the start block number.
2.Consider optimizing the setting of the start block number range not to exceed the latest block number.
3.Add a reminder that the start block number has been set.

@Danie0918 Danie0918 self-assigned this Oct 20, 2023
@Danie0918 Danie0918 added this to Neuron Oct 20, 2023
@Danie0918 Danie0918 moved this to 📌Planning in Neuron Oct 20, 2023
@Danie0918 Danie0918 added the enhancement New feature or request label Oct 20, 2023
@Danie0918
Copy link
Contributor Author

Danie0918 commented Oct 24, 2023

PRD

【Optimize the setting of sync start block in light client mode】

  • Requirement Description:When the block number set by the user is after the historical transaction block number, then the historical transaction will not be synchronized, but displaying 100% synchronization can be misleading to the user.

optimize_the_setting_of_sync_start_block_in_light_client_mode

  • Requirement Contents
  1. Add a strong prompt when setting the starting block number and require 5 seconds before clicking to confirm the operation.
  2. When the set block number is larger than the latest block number, an error is reported prompting the user and making the Confirm button unavailable.
  3. Add manually set starting block in the Synchronization dropdown box to support opening the corresponding block in the Explorer.
  4. When the re-entered block number is smaller than before, the user needs to be prompted that it will be re-synchronized and provided with a 5-second confirmation.

@Danie0918 Danie0918 moved this from 📌Planning to 🎨 Designing in Neuron Oct 24, 2023
@yanguoyu
Copy link

  1. image

Is it a wrong description? Does it should be Set start block number? Or do you mean it will clear all synchronized data and start from the setting start block number?

  1. When the set block number is larger than the latest block it errors and changes the set block number to the latest block number, and it takes 5s to confirm.

It notifies that unable to set a higher block number, should we disable the confirm button? Then it is unnecessary to take 5s to confirm. Another problem is that the latest block number will increase about every 10s, so should we refresh the latest block number and check whether the number is bigger every 10s

@Danie0918
Copy link
Contributor Author

Danie0918 commented Oct 24, 2023

Is it a wrong description? Does it should be Set start block number? Or do you mean it will clear all synchronized data and start from the setting start block number?

I'll change it. It's still set synchronization start block.

It notifies that unable to set a higher block number, should we disable the confirm button? Then it is unnecessary to take 5s to confirm. Another problem is that the latest block number will increase about every 10s, so should we refresh the latest block number and check whether the number is bigger every 10s

Of course, it would be better to just disable it, I had previously thought that we couldn't get the latest blocks in real time.

It doesn't need to be very real-time here, refreshing is unnecessary.

@yanguoyu
Copy link

I suggest clearing all synchronized data and starting from the setting start block number if the set start block number is smaller than the last setting(or synced block number). When users set a smaller setting, it will not sync from the smaller setting because the light client has synced to a higher block number.
Should we notify the user or default execute that?

@Danie0918
Copy link
Contributor Author

I suggest clearing all synchronized data and starting from the setting start block number if the set start block number is smaller than the last setting(or synced block number). When users set a smaller setting, it will not sync from the smaller setting because the light client has synced to a higher block number. Should we notify the user or default execute that?

Notifying the user would be better, I'll add a popup alert later.

@Danie0918 Danie0918 moved this from 🎨 Designing to 🏗 In Progress in Neuron Nov 28, 2023
@Keith-CY
Copy link
Member

Another note could be added that if there are no transactions on the chain, or users assure there are no transactions on the chain, the tip block number could be set.

This note comes from the case that users find empty transaction lists on the explorer and they don't know how to continue.

@Danie0918
Copy link
Contributor Author

Another note could be added that if there are no transactions on the chain, or users assure there are no transactions on the chain, the tip block number could be set.

This note comes from the case that users find empty transaction lists on the explorer and they don't know how to continue.

Is this prompted when setting the start block?But for new wallets, we are not prompted to set the start block.

@Keith-CY
Copy link
Member

Another note could be added that if there are no transactions on the chain, or users assure there are no transactions on the chain, the tip block number could be set.
This note comes from the case that users find empty transaction lists on the explorer and they don't know how to continue.

Is this prompted when setting the start block?But for new wallets, we are not prompted to set the start block.

Yes, it should be noted when setting the start point, but it's not the case of a freshly generated wallet(and a new wallet doesn't need the step of specifying the start point because it will be done automatically).

It's the case that a wallet was created before but never used. So the user cannot find the earliest transaction on ckb explorer when the wallet is imported.

@Danie0918
Copy link
Contributor Author

Another note could be added that if there are no transactions on the chain, or users assure there are no transactions on the chain, the tip block number could be set.

This note comes from the case that users find empty transaction lists on the explorer and they don't know how to continue.

image

In order to be compatible with the case of setting the starting block for wallets with no transaction history, we have divided the case of setting the starting block into 2 cases:

  1. Wallet with transaction history : Please note that transactions before the synchronization start block will not be synchronized!
  2. Wallets without transaction history : No transaction history found, you can start synchronizing from the latest block or any known block.

What do you think about this? @Keith-CY @yanguoyu

@Keith-CY
Copy link
Member

Keith-CY commented Dec 2, 2023

Another note could be added that if there are no transactions on the chain, or users assure there are no transactions on the chain, the tip block number could be set.
This note comes from the case that users find empty transaction lists on the explorer and they don't know how to continue.

image

In order to be compatible with the case of setting the starting block for wallets with no transaction history, we have divided the case of setting the starting block into 2 cases:

  1. Wallet with transaction history : Please note that transactions before the synchronization start block will not be synchronized!
  2. Wallets without transaction history : No transaction history found, you can start synchronizing from the latest block or any known block.

What do you think about this? @Keith-CY @yanguoyu

I'm afraid these two messages should be displayed at the same time because Neuron cannot get the transaction count before the synchronization.

@yanguoyu
Copy link

@Danie0918 Danie0918 moved this from 🏗 In Progress to 🔎 Code Review in Neuron Dec 25, 2023
@Danie0918 Danie0918 moved this from 🔎 Code Review to 👀 Testing in Neuron Jan 12, 2024
@Danie0918 Danie0918 assigned silySuper and unassigned yanguoyu Jan 12, 2024
@silySuper
Copy link

verified

@Danie0918 Danie0918 moved this from 👀 Testing to 🚩Pre Release in Neuron Jan 19, 2024
@Danie0918 Danie0918 moved this from 🚩Pre Release to ✅ Done in Neuron Aug 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: ✅ Done
Development

No branches or pull requests

5 participants