paritytech / substrate-debug-kit

A collection of debug tools, scripts and libraries on top of substrate.
GNU General Public License v3.0
94 stars 36 forks source link

offline-election block in get_candidates and then loop print ws closed error #29

Open yrong opened 3 years ago

yrong commented 3 years ago

run this command

run --package offline-election --bin offline-election -- --uri wss://cc1.darwinia.network --network darwinia staking

and blocked here for 10 secs and then loop print error as following

[2020-12-03T08:53:48Z ERROR] Client Error: Inner(Ws(Closed))
[2020-12-03T08:53:48Z ERROR] Client Error: Inner(Ws(Closed))
....
yrong commented 3 years ago

notice issue and seems similar

@AurevoirXavier @HackFisher

will this hack work?

https://github.com/darwinia-network/bridger/commit/d70d76ce5f26fd0d7baaa6f06ff3f5163556f0ed

AurevoirXavier commented 3 years ago

Yes, works. But that hack kind dirty & ugly.

yrong commented 3 years ago

@AurevoirXavier notice that this lib use state_getPairs to get all validators https://github.com/paritytech/substrate-debug-kit/blob/22f804bbdbaa3c7068baf33e950bbcf0e04f3d90/offline-election/src/subcommands/staking.rs#L37 and take too long to timeout, will it better to use state_getKeysPaged instead?