paritytech / substrate-debug-kit

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

Option::unwrap()` on a `None` value #10

Closed hodl-dot-farm closed 4 years ago

hodl-dot-farm commented 4 years ago

I see this error when running freshly compiled executable:

 ~/workspace/offline-phragmen () $ ./target/release/offline-phragmen --uri wss://kusama-rpc.polkadot.io/.
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', src/main.rs:142:46
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
wpank commented 4 years ago

I also get this issue when trying to connect to another URI. It works fine if you use the a local node, however.

kianenigma commented 4 years ago

I just updated the latest master with all the latest changes to kusama/substrate. Can you see if you can reproduce.

Also, checkout the new README for additional flags and such.

wpank commented 4 years ago

Trying to use another URI like:

./target/release/offline-phragmen --uri wss://kusama-rpc.polkadot.io/ -vv staking --count 50

Will cause the call the just hang there. I left it for 10 mins - does this take a long time or am I using it wrong?

wpank commented 4 years ago

Also when running with a local node I get this:

./target/release/offline-phragmen -vv staking 

thread 'main' panicked at 'All stashes must have 'Bonded' storage.', src/subcommands/staking.rs:90:1
kianenigma commented 4 years ago

You probably have an outdated lockfile and are building something old. I updated the Cargo.lock now. Can you rebuild with this? Both of the examples work for me. A remote node will take some minutes though, I recommend using a local one if you have. Run with RUST_LOG=offline-phragmen=trace to see the progress.

wpank commented 4 years ago
❯ RUST_LOG=offline-phragmen=trace ./target/release/offline-phragmen --uri wss://kusama-rpc.polkadot.io/ -vv staking --count 50
[2020-05-17T07:38:24Z TRACE offline_phragmen::subcommands::staking] [0] retaining 16/16 nominations for e57b16b0210195cdea03ba37940ddc215e74f5f53a3efbb8b36ea39021aa56a9 (HmD3ksmD...)
[2020-05-17T07:38:28Z TRACE offline_phragmen::subcommands::staking] [1] retaining 16/16 nominations for 3c4c4c6d63e1428b8450773a851ad4d3eb76c2f5a4fa1722b5d84cf54cf6ba56 (DwP4DYXv...)
[2020-05-17T07:38:28Z TRACE offline_phragmen::subcommands::staking] [2] retaining 0/2 nominations for d83d86da503b26bc9c143fcff1819463b71da229d147d262d493d29b24502738 (HTr8xzJq...)
[2020-05-17T07:38:29Z TRACE offline_phragmen::subcommands::staking] [3] retaining 5/5 nominations for a6ff2197e260745daf5ae4c9f73ec52ddb19dd9d9f4a31786ec16ecc54430a5f (GMHFpxFv...)
[2020-05-17T07:38:33Z TRACE offline_phragmen::subcommands::staking] [4] retaining 16/16 nominations for d033ca16a330cf722e09b908a545818f8e2880a221d16d902923ada564b4b646 (HHJrycDz...)
[2020-05-17T07:38:38Z TRACE offline_phragmen::subcommands::staking] [5] retaining 16/16 nominations for 3c065ccef6192521a636f3538fbbec416a221167f1e45642e96650850b23ad21 (Dw2HFKQU...)
[2020-05-17T07:38:39Z TRACE offline_phragmen::subcommands::staking] [6] retaining 6/6 nominations for f8d71083c3280ba3b5451d4f25adf0b6f1a96974429a89c20c610c6375ae517b (JCbHEWuV...)
[2020-05-17T07:38:40Z TRACE offline_phragmen::subcommands::staking] [7] retaining 5/5 nominations for 241f7a3b6d966490ca6a0f96434b6217df25cf696c528b3ffbbca98149b8d772 (DPgbK5Hs...)
[2020-05-17T07:38:43Z TRACE offline_phragmen::subcommands::staking] [8] retaining 12/12 nominations for de2c2e5e4feb75c8f45d3b859979255ed0e726c5961652c935edb0125905ac1e (HbdGmhkD...)
[2020-05-17T07:38:43Z TRACE offline_phragmen::subcommands::staking] [9] retaining 0/1 nominations for 841e7556b672e87740fd3226ba2a74c76f6ff9633ccbbd4edaf4fb47ac943a3e (FZYtNjYE...)
[2020-05-17T07:38:46Z TRACE offline_phragmen::subcommands::staking] [10] retaining 16/16 nominations for 708ad35d8893cc19d97c4fa924064a034581f02f41ed819dd24572e78d4577da (F7t7xJK8...)
[2020-05-17T07:38:47Z TRACE offline_phragmen::subcommands::staking] [11] retaining 3/3 nominations for 6a369a0f29783b217c7d260107c995dacb67f81a962d8adee64bb5b1325e2843 (Eyap9VM4...)
[2020-05-17T07:38:48Z TRACE offline_phragmen::subcommands::staking] [12] retaining 2/3 nominations for 2c956ddf4801b792e947214eef93e2380945ed575209fd48d312a49cbc8c3320 (Dan1nsgW...)

@kianenigma This looks fine now - I'm going to close this issue