neuron icon indicating copy to clipboard operation
neuron copied to clipboard

fix: Fix socket hang

Open yanguoyu opened this issue 1 year ago • 8 comments

Refer to https://github.com/Magickbase/neuron-public-issues/issues/389

yanguoyu avatar May 07 '24 10:05 yanguoyu

/package Packaging for test is done in 8983636524. @yanguoyu

yanguoyu avatar May 07 '24 10:05 yanguoyu

@Keith-CY Please prioritize this PR for review and merge because the related issue may block syncing.

twhy avatar May 09 '24 00:05 twhy

Can not sync ,always show sync not start yet. 截屏2024-05-09 10 38 47 main.log

node log: 截屏2024-05-09 10 40 56 截屏2024-05-09 10 39 22

silySuper avatar May 09 '24 02:05 silySuper

Can not sync ,always show sync not start yet. 截屏2024-05-09 10 38 47 main.log

node log: 截屏2024-05-09 10 40 56 截屏2024-05-09 10 39 22

Hi, do you use the package from https://github.com/nervosnetwork/neuron/actions/runs/8983636524? I had no issues with socket hang after using this package. @silySuper

yanguoyu avatar May 09 '24 03:05 yanguoyu

Can not sync ,always show sync not start yet. 截屏2024-05-09 10 38 47 main.log node log: 截屏2024-05-09 10 40 56 截屏2024-05-09 10 39 22

Hi, do you use the package from https://github.com/nervosnetwork/neuron/actions/runs/8983636524? I had no issues with socket hang after using this package. @silySuper

yes,i am using this package

silySuper avatar May 09 '24 06:05 silySuper

Sorry for replying late. I wanted to let you know that starting from [email protected], you can now customize the fetch of the package @ckb-lumos/rpc using https://github.com/ckb-js/lumos/pull/574. You can achieve this by using the following code:

new RPC('https...', { fetch: globalThis.fetch })

I suggest trying out the NodeJS's native fetch, which is stable from Node@21, although Neuron is currently using [email protected].

homura avatar May 09 '24 09:05 homura

Sorry for replying late. I wanted to let you know that starting from [email protected], you can now customize the fetch of the package @ckb-lumos/rpc using ckb-js/lumos#574. You can achieve this by using the following code:

new RPC('https...', { fetch: globalThis.fetch })

I suggest trying out the NodeJS's native fetch, which is stable from Node@21, although Neuron is currently using [email protected].

Hi, the Indexer constructor doesn't have the fetch option. And the Neuron throws socket hang at https://github.com/nervosnetwork/neuron/blob/v0.114.3/packages/neuron-wallet/src/block-sync-renderer/sync/indexer-cache-service.ts#L81.

yanguoyu avatar May 09 '24 09:05 yanguoyu

Hi, the Indexer constructor doesn't have the fetch option. And the Neuron throws socket hang at

Lumos needs to allow for customizing the fetch function in the Indexer. Therefore, the node-fetch override is still necessary now

homura avatar May 09 '24 09:05 homura

ckb node V114.0 to run v108 data can not sync,I tried ckb node v115 can sync

silySuper avatar May 10 '24 08:05 silySuper

/package Packaging for test is done in 9072905547. @silySuper

silySuper avatar May 14 '24 02:05 silySuper

@silySuper This PR should be merged first, it will block testing other PRs that use full-node synchronized

yanguoyu avatar May 14 '24 03:05 yanguoyu

截屏2024-05-14 11 24 58

new data can sync ,but old data can not sync in my computer

silySuper avatar May 14 '24 03:05 silySuper

截屏2024-05-14 11 24 58 new data can sync ,but old data can not sync in my computer

From your provider log, your old data has broken. I guess it's normal because your ckb node can't run success with old data.

yanguoyu avatar May 14 '24 03:05 yanguoyu

socket hang fix verified

silySuper avatar May 14 '24 06:05 silySuper