smol-dot / smoldot

Lightweight client for Substrate-based chains, such as Polkadot and Kusama.
GNU General Public License v3.0
189 stars 50 forks source link

Warp sync regression for smoldot v0.18 #1896

Open lexnv opened 4 months ago

lexnv commented 4 months ago

The current version of smoldot is slower to sync to the head of the polkadot chain, as detected by:

15:22:59.314045Z TRACE subxt-light-client-background-task Received from smoldot response='{"jsonrpc":"2.0","id":"9","result":"0xa9a22c3a556f0e9256cb98c0e99490b3b82e10f1c4ca1dd4b80cf144b06eb4e4"}' chain=ChainId(0)
Finalized hash: 0xa9a22c3a556f0e9256cb98c0e99490b3b82e10f1c4ca1dd4b80cf144b06eb4e4 took 975.477µs

15:25:50.187944Z sync-service-polkadot warp-sync-chain-information-build-success 
15:25:50.188179Z sync-service-polkadot GrandPa warp sync finished to #21372707 (0x8335…1420) 
15:25:53.922377Z INFO runtime-polkadotSuccessfully compiled runtime. Spec version: 1002004. Size of `:code`: 1.5 MiB. 

15:25:53.923444Z TRACE subxt-light-client-background-task Received from smoldot response='{"jsonrpc":"2.0","id":"11","result":{"parentHash":"0xec91a63f92615a4da43c3a116deef5367e416e4860bbe92dbadb0c7cb2d1b019","extrinsicsRoot":"0x2bd1e3e97ed1a08afd6fcbc4d6df599ad74625715b6761675d22f5e334de467c","stateRoot":"0xe41a8120251c7a800d329b69a01e6d912615' chain=ChainId(0)
Second block took 174.610506318s

Version used (a similar behavior is present on origin/main):

With an older version of smoldot v0.16.0 and smoldot-light v0.14.0 the syncing + subxt testing takes ~30ms

smoldot-logs-grandpa.txt

Let me know if I could provide more info, thanks 🙏

tomaka commented 4 months ago

Problem seems to be exactly as the same as https://github.com/smol-dot/smoldot/issues/1638 (cc comments in https://github.com/smol-dot/smoldot/issues/1754)

Has https://github.com/paritytech/polkadot-sdk/pull/4135 been released yet?

lexnv commented 4 months ago

I had a look over our infrastructure. The public RPCs seem to be running tag: v1.13.0-rc3, from commit d5160c1d567. This contains the grandpa neighbour packet fix.

Sorry for duplicating the issue, initially the old RPC where not producing a second block. Now the second block is produced after ~175 seconds 🙏