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 adapt light client #125

Closed
6 tasks done
yanguoyu opened this issue Apr 6, 2023 · 25 comments
Closed
6 tasks done

Fix adapt light client #125

yanguoyu opened this issue Apr 6, 2023 · 25 comments
Assignees
Labels
bug Something isn't working

Comments

@yanguoyu
Copy link

yanguoyu commented Apr 6, 2023

  • Adapt multisig.
  • Hide the data set when the node is light, and clear all synchronized data
  • Some cell dep is not in block 0, we need to fetch these transactions.
  • Add export light client log.
  • Can clear light client sync data
  • Some APIs are not in light client, so we need to adapt these APIs. get_header_by_number, get_live_cell, get_blockchain_info
@yanguoyu yanguoyu self-assigned this Apr 6, 2023
@Dawn-githup
Copy link

Dawn-githup commented Apr 7, 2023

optimization
  • Creating a new wallet, allowing it to sync from the latest block.

@Danie0918 Danie0918 added the bug Something isn't working label Apr 10, 2023
@Keith-CY
Copy link
Member

Keith-CY commented Apr 13, 2023

Send a timelock transaction to local wallet and the record will be added in customized assets, but method not found error will be thrown on clicking the claim button

Screen.Recording.2023-04-13.at.13.55.02.mov

Happens on withdrawing from nervos dao

Screen.Recording.2023-04-13.at.16.09.24.mov

@Dawn-githup
Copy link

Dawn-githup commented Apr 13, 2023

overview

  • Transactions can be found on light nodes, but cannot be retrieved from the full node that the light node is connected to.
  • The input for transaction details is displaying abnormally

send

  • Currently, setting the setLock function can cause the output lock script to be collected by users, but time locks sent by non-inherited wallets cannot be collected by the wallet.

Receive

  • Using seven different accounts, the amount of change can be multiplied by 12 on each account.

nervos dao

  • Locked does not display the number of CKBs for deposits
  • The current APC is 0.
  • "Deposit" progress bar doesn't budge.
  • "Withdraw" button prompts error message saying "Method Not Found."
  • CKB interest has always been 0
  • The next compensation cycle will start in approximately NaN days

cutomized Assets

  • turn into a new sudt asset account, need fetchTx
  • Transfer to a sUDT asset account did not attempt successfully
  • Send mnft, prompt method not found
  • claim failed

asset account

  • Report of transfer failure: there isn't accountwallet a...
  • Send report Insufficient
  • Create an asset Account and report an error, fetchTransaction is required

tools

  • Clean data Delete data from light nodes

perference

data
  • When the network type is the light node test network, the current path is the main network, and it is expected to be a light node
network
  • Synchronize multi-signature information, synchronize wallet information, and the main network node will be closed. Currently, there is no synchronization of multi-signature addresses
  • If port 9000 is occupied, the error message is not obvious, and the user cannot locate the cause of the error If the ckb or ckb-light-client port is used, optimize the continue progress. #135
  • Switch the light node (test network) to main, and currently the light node will not be shut down

close wallet

  • At present, the main node will be shut down, while the light node has not been shut down

@Keith-CY
Copy link
Member

Keith-CY commented Apr 13, 2023

Clearing cache(without rebuild index) during synchronization wipes history before this action out.

image


Screenshot from another PC
image


Transactions before 2023-03-31 are lost


Clear cache again after synchronization is done, history is correct

@Keith-CY

This comment was marked as resolved.

@Keith-CY

This comment was marked as resolved.

@yanguoyu
Copy link
Author

When I tried to convert one into a SUDT account, unknown outpoint error appeared. It usually happens when an input has been consumed. So I cleared cache and tried again, still got this error

This is because of this: Some cell dep is not in block 0, we need to fetch these transactions.
I have not fixed it yet.

@Keith-CY
Copy link
Member

Keith-CY commented Apr 13, 2023

When I tried to convert one into a SUDT account, unknown outpoint error appeared. It usually happens when an input has been consumed. So I cleared cache and tried again, still got this error

This is because of this: Some cell dep is not in block 0, we need to fetch these transactions. I have not fixed it yet.

Ah I see, I was misled by my experience about unknown outpoint

@yanguoyu
Copy link
Author

Currently, setting the setLock function can cause the output lock script to be collected by users, but time locks sent by non-inherited wallets cannot be collected by the wallet.

Because the timelock script is not predictable, the light client will not support show timelock cells. Shall we disable timelock when sending ckb for the light client? @Keith-CY

If port 9000 is occupied, the error message is not obvious, and the user cannot locate the cause of the error

The Port 9000 is occupied include two conditions:

  1. The user has started ckb-light-client locally by themself.
  2. The user uses Port 9000 for other servers.
    How should we prompt better for users?

@Keith-CY
Copy link
Member

Keith-CY commented Apr 20, 2023

Currently, setting the setLock function can cause the output lock script to be collected by users, but time locks sent by non-inherited wallets cannot be collected by the wallet.

Because the timelock script is not predictable, the light client will not support show timelock cells. Shall we disable timelock when sending ckb for the light client? @Keith-CY

If port 9000 is occupied, the error message is not obvious, and the user cannot locate the cause of the error

The Port 9000 is occupied include two conditions:

  1. The user has started ckb-light-client locally by themself.
  2. The user uses Port 9000 for other servers.
    How should we prompt better for users?

@Danie0918 @Sven-TBD please list the all inaccessible assets in light client mode and add prompts on sending/receiving them.

For instance, when the user tries to send someone with timelock, the prompt please inform receiver to check the assets in full node mode should appear beneath the address field, as we did before
image

Meanwhile, a prompt should be displayed in the customized assets panel when neuron is in light client mode, to let users know some assets are only visible in full node mode(with a button/link to network config)

@yanguoyu
Copy link
Author

Meanwhile, a prompt should be displayed in the customized assets panel when neuron is in light client mode, to let users know some assets are only visible in full node mode(with a button/link to network config)

As I know, currently when Neuron use ckb-light-client, it will not support collecting cheque, locktime cells, and sending SUDT to other users' ACP address.

@Danie0918
Copy link
Contributor

Currently, setting the setLock function can cause the output lock script to be collected by users, but time locks sent by non-inherited wallets cannot be collected by the wallet.

Because the timelock script is not predictable, the light client will not support show timelock cells. Shall we disable timelock when sending ckb for the light client? @Keith-CY

If port 9000 is occupied, the error message is not obvious, and the user cannot locate the cause of the error

The Port 9000 is occupied include two conditions:

  1. The user has started ckb-light-client locally by themself.
  2. The user uses Port 9000 for other servers.
    How should we prompt better for users?

@Danie0918 @Sven-TBD please list the all inaccessible assets in light client mode and add prompts on sending/receiving them.

For instance, when the user tries to send someone with timelock, the prompt please inform receiver to check the assets in full node mode should appear beneath the address field, as we did before image

Meanwhile, a prompt should be displayed in the customized assets panel when neuron is in light client mode, to let users know some assets are only visible in full node mode(with a button/link to network config)

I understand that there are 2 requirements here, when the user is in light node mode

  1. Users need to be prompted when receiving/sending assets that cannot be accessed by light nodes
  2. Prompt users in custom assets that some assets are only visible in full node mode and provide a button to jump to network settings

Here are a few questions

  1. How to find the assets that light nodes cannot access?
  2. Does history need to add similar hints?
  3. Do asset accounts need to add similar prompts?

@Keith-CY
Copy link
Member

Currently, setting the setLock function can cause the output lock script to be collected by users, but time locks sent by non-inherited wallets cannot be collected by the wallet.

Because the timelock script is not predictable, the light client will not support show timelock cells. Shall we disable timelock when sending ckb for the light client? @Keith-CY

If port 9000 is occupied, the error message is not obvious, and the user cannot locate the cause of the error

The Port 9000 is occupied include two conditions:

  1. The user has started ckb-light-client locally by themself.
  2. The user uses Port 9000 for other servers.
    How should we prompt better for users?

@Danie0918 @Sven-TBD please list the all inaccessible assets in light client mode and add prompts on sending/receiving them.
For instance, when the user tries to send someone with timelock, the prompt please inform receiver to check the assets in full node mode should appear beneath the address field, as we did before image
Meanwhile, a prompt should be displayed in the customized assets panel when neuron is in light client mode, to let users know some assets are only visible in full node mode(with a button/link to network config)

I understand that there are 2 requirements here, when the user is in light node mode

  1. Users need to be prompted when receiving/sending assets that cannot be accessed by light nodes
  2. Prompt users in custom assets that some assets are only visible in full node mode and provide a button to jump to network settings

Here are a few questions

  1. How to find the assets that light nodes cannot access?
  2. Does history need to add similar hints?
  3. Do asset accounts need to add similar prompts?

The prompts for senders should be displayed in both full-node and light-client modes because whether the assets are visible depends on the receiver, not the sender. So senders should be informed how the receiver can verify it.

The prompts for receivers only show in light-client mode because full-node reveals all assets.

@Keith-CY
Copy link
Member

Keith-CY commented Apr 20, 2023

How to find the assets that light nodes cannot access?

  • timelock assets in customized assets
  • cheque assets in customized assets

Does history need to add similar hints?

It would be considerate to show these hints on the history page

Do asset accounts need to add similar prompts?

When sending sudt to others, the sudt only appears when the receiver has a corresponding asset account.
As mentioned below, it takes a long time to fetch receiver's asset account cell, so this function will be disabled

The underlying mechanism is that only a known script will be synced in the light client mode. If receiver doesn't have the corresponding asset account, it doesn't know the sudt script(the code hash is unknown) to sync.

The two assets are inaccessible because

  • timelock assets in customized assets: unknown args because timelock requires since field in the args
  • cheque assets in customized assets: unknown args becausecheque assets'args` is sender's

@yanguoyu
Copy link
Author

yanguoyu commented Apr 20, 2023

When sending sudt to others, the sudt only appears when the receiver has a corresponding asset account.

Neuron with ckb-light-client will not support sending sudt to other users' ACP address, because we cannot get the cell that lock script is other user's ACP lock script. The user can only send to other users with lock 162 ckb or extra 142 ckb.

@Keith-CY
Copy link
Member

When sending sudt to others, the sudt only appears when the receiver has a corresponding asset account.

Neuron with ckb-light-client will not support sending sudt to other users' ACP address, because we cannot get the cell that lock script is other user's ACP lock script. The user can only send to other users with lock 162 ckb or extra 142 ckb.

To be more precise, it takes a long time to fetch receiver's asset account cell which is not user friendly, so the function is disabled

@Keith-CY
Copy link
Member

Keith-CY commented Apr 28, 2023

A detail can be considered but left for optimization in the future

If a sudt/secp256k1 is received, it will be listed in customized assets and can be

  1. turned into an asset account
  2. transferred to an asset account
    image

Option 2 allows the user to send to the other's asset account(by inputting an address), which is disabled in asset account tab because it takes time to fetch the receiver's cell.

image

So the interaction can be changed to disable inputting that the user can only pick up an internal asset account to send.

@yanguoyu
Copy link
Author

yanguoyu commented May 5, 2023

So the interaction can be changed to disable inputting that the user can only pick up an internal asset account to send.

nervosnetwork/neuron#2653

@Dawn-githup
Copy link

Dawn-githup commented May 8, 2023

Second Phase Testing and Validation of Neuron

overview

  • The input of transaction details is displayed abnormally

Send

  • Switch to the main network first, and then switch to the light node. The set lock function appears

nervos dao

tools

  • The multisig address Windows version is not deleted

perference

  • Error indicating network abnormality when clearing data
  • After clearing data, switching accounts, data synchronization needs to start from 0 ?
  • wallets
  • Cannot remove multisig accounts set up in other wallets
  • Create a new wallet, optimize the spacing of mnemonic word arrangement
  • network
  • Error message indicating port allocation is in use is not prominent, making it difficult for users to identify the cause of the error

cutomized Assets

@yanguoyu
Copy link
Author

yanguoyu commented May 9, 2023

Create a new wallet, optimize the spacing of mnemonic word arrangement

The new-ui will use a new design, so it will not optimize currently.

Error message indicating port allocation is in use is not prominent, making it difficult for users to identify the cause of the error

It's duplicated with #135

@yanguoyu
Copy link
Author

yanguoyu commented May 9, 2023

After clearing data, switching accounts, data synchronization needs to start from 0 ?

Currently, we can clean the current wallet block number when you clear data, then when you switch to another wallet, it will start from the last. But for the current wallet, it will start from 0. @Dawn-githup What do you think about this?

@Dawn-githup
Copy link

After clearing data, switching accounts, data synchronization needs to start from 0 ?

Currently, we can clean the current wallet block number when you clear data, then when you switch to another wallet, it will start from the last. But for the current wallet, it will start from 0. @Dawn-githup What do you think about this?

The scenario where users simultaneously use two wallets is not frequent, and if it can be optimized, it would be more user-friendly.

@Dawn-githup
Copy link

Dawn-githup commented May 18, 2023

Third-stage testing and verification of neurons

Overview

  • The input for transaction details only displays 10 accounts
    image

Receive---address book

  • Using 7 accounts can generate 12 additional accounts.
  • Generate 12 accounts, while the height of newly generated accounts lags behind the latest synchronization height
    idx:0,sync blockNo:9329146 ckb address:ckt1qq6pngwqn6e9vlm92th84rk0l4jp2h8lurchjmnwv8kq3rt5psf4vqg29eguzu82zwt7vpgufdy8flzn8zcc84gd2cnfl codeHash:0x3419a1c09eb2567f6552ee7a8ecffd64155cffe0f1796e6e61ec088d740c1356 idx:1,sync blockNo:9329146 ckb address:ckt1qq6pngwqn6e9vlm92th84rk0l4jp2h8lurchjmnwv8kq3rt5psf4vqgjvu6anzc02uvpukw76gy82cr4q9gmnkgy6a60l codeHash:0x3419a1c09eb2567f6552ee7a8ecffd64155cffe0f1796e6e61ec088d740c1356 idx:2,sync blockNo:9329146 ckb address:ckt1qq6pngwqn6e9vlm92th84rk0l4jp2h8lurchjmnwv8kq3rt5psf4vqg5whj7pnrcrlkg022l0d9tf9zy7rphaacckzdpz codeHash:0x3419a1c09eb2567f6552ee7a8ecffd64155cffe0f1796e6e61ec088d740c1356 idx:3,sync blockNo:9329146 ckb address:ckt1qq6pngwqn6e9vlm92th84rk0l4jp2h8lurchjmnwv8kq3rt5psf4vqgkszkyznz7fdywa6ke30j5fdemgu7g2dgaluahr codeHash:0x3419a1c09eb2567f6552ee7a8ecffd64155cffe0f1796e6e61ec088d740c1356 idx:4,sync blockNo:9329146 ckb address:ckt1qq6pngwqn6e9vlm92th84rk0l4jp2h8lurchjmnwv8kq3rt5psf4vqg67qldecchzx6395uftttf2xwz3g3dfgq0jqgzz codeHash:0x3419a1c09eb2567f6552ee7a8ecffd64155cffe0f1796e6e61ec088d740c1356 idx:5,sync blockNo:9234000 ckb address:ckt1qq6pngwqn6e9vlm92th84rk0l4jp2h8lurchjmnwv8kq3rt5psf4vqftecfefxzktryqnfw80p0dquf52s890cqflrsfm codeHash:0x3419a1c09eb2567f6552ee7a8ecffd64155cffe0f1796e6e61ec088d740c1356 idx:6,sync blockNo:9329146 ckb address:ckt1qq6pngwqn6e9vlm92th84rk0l4jp2h8lurchjmnwv8kq3rt5psf4vqfwl5nte3hnsrx24nfnf40a825ft59naqghp4hh7 codeHash:0x3419a1c09eb2567f6552ee7a8ecffd64155cffe0f1796e6e61ec088d740c1356 idx:7,sync blockNo:9329146 ckb address:ckt1qq6pngwqn6e9vlm92th84rk0l4jp2h8lurchjmnwv8kq3rt5psf4vqfjesgentwcw8qpeytk48dqjch7qxgfltgzweg3q codeHash:0x3419a1c09eb2567f6552ee7a8ecffd64155cffe0f1796e6e61ec088d740c1356 idx:8,sync blockNo:9329146 ckb address:ckt1qq6pngwqn6e9vlm92th84rk0l4jp2h8lurchjmnwv8kq3rt5psf4vqfm438cfjq9qvwmh7ha6a8tlvnswdwqtlcwt7lhr codeHash:0x3419a1c09eb2567f6552ee7a8ecffd64155cffe0f1796e6e61ec088d740c1356 idx:9,sync blockNo:9329146 ckb address:ckt1qq6pngwqn6e9vlm92th84rk0l4jp2h8lurchjmnw

perference---data

  • Windows: After clearing data, the light node starts normally, but the synchronization information remains stuck at 0
    image
    image

  • Mac: Synchronized, but balance not refreshed
    image
    logs:
    no-sync-after-remove-data.zip

tools---clean data

  • Light nodes are out of sync after clearing data
  • After clearing all data, the imported account did not resynchronize from 0

nervos dao---deposit

  • Confirm the progress bar problem
    image

Environmental installation---windows

  • Two dependent C++installations are required to use
  • Add environment variable path;% SystemRoot%\system32;% SystemRoot%;% SystemRoot%\System32\Wbem;
  • May require documentation for user convenience

@yanguoyu
Copy link
Author

The input for transaction details only displays 10 accounts

It's a feature.

Two dependent C++installations are required to use
Add environment variable path;% SystemRoot%\system32;% SystemRoot%;% SystemRoot%\System32\Wbem;

duplicate with #134

@yanguoyu
Copy link
Author

Light nodes are out of sync after clearing data
After clearing all data, the imported account did not resynchronize from 0
Windows: After clearing data, the light node starts normally, but the synchronization information remains stuck at 0

Fixed by nervosnetwork/neuron#2675

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

No branches or pull requests

4 participants