stakwork / sphinx-key

Lightning hardware signer on ESP32
28 stars 1 forks source link

Index 8 out of range for slice of length 0 #129

Open irriden opened 10 months ago

irriden commented 10 months ago

This happens on a loop after I try to connect a second signer while a first signer does keysends with the broker.

This might be hard to reproduce, might be a one-off - not quite sure what happened.

I (12304) esp_idf_svc::sntp: Dropped                                                                                                                          
Completed the time sync, here is the UNIX time: 1695343612                                                                                                    
I (12364) sphinx_key::periph::led: LED STATUS: ConnectingToMqtt                                                                                               
I (12474) sphinx_key: PUBKEY 02bc855fd72bc8f9240917f848651de15614334de1db5ab4eef014fc4e6c187a4f TOKEN ZQzj_B-S5KAtBaOsP6d_1_-m7N5sNPtkQkRRxOIl6l6vtBR_blA-aa-I
lzcIVPDYE5HjNGc8sM42Hi7F7rs08RyC75rz                                                                                                                          
I (12474) sphinx_key::conn::mqtt: make_client with id 6edb9d322098987132548aa64a1d78fb                                                                        
I (12484) sphinx_key::conn::mqtt: => connect to MQTT at mqtt://192.168.86.26:1883                                                                             
I (12504) sphinx_key::conn::mqtt: MQTT client started                                                                                                         
I (12504) sphinx_key::conn::mqtt: MQTT Listening for messages                                                                                                 
I (12504) sphinx_key::conn::mqtt: RECEIVED BeforeConnect MESSAGE                                                                                              
I (12514) sphinx_key: Network set to Regtest                                                                                                                  
I (12524) sphinx_key: >>>>>>>>>>> blocking forever...                                                                                                         
I (12524) sphinx_key: Config { broker: "192.168.86.26:1883", ssid: "HarrisHouse", pass: "citadel212", network: "regtest" }I (12534) sphinx_key::conn::mqtt: RE
CEIVED Connected MESSAGE

I (12544) sphinx_key::core::events: BROKER IP AND PORT: 192.168.86.26:1883
I (12554) sphinx_key::core::events: SUBSCRIBE to 6edb9d322098987132548aa64a1d78fb/vls
I (12564) sphinx_key::core::events: SUBSCRIBE to 6edb9d322098987132548aa64a1d78fb/control
I (12564) sphinx_key::conn::mqtt: RECEIVED Subscribed MESSAGE
I (12574) sphinx_key::core::events: SUBSCRIBE to 6edb9d322098987132548aa64a1d78fb/proxy
I (12584) sphinx_key::conn::mqtt: RECEIVED Subscribed MESSAGE
I (12594) sphinx_key::core::events: SUBSCRIBE to 6edb9d322098987132548aa64a1d78fb/init-1-msg
I (12594) sphinx_key::conn::mqtt: RECEIVED Subscribed MESSAGE
I (12604) sphinx_key::core::events: SUBSCRIBE to 6edb9d322098987132548aa64a1d78fb/init-2-msg
I (12614) sphinx_key::core::events: SUBSCRIBE to 6edb9d322098987132548aa64a1d78fb/lss-msg
I (12624) sphinx_key::core::events: SUBSCRIBE to 6edb9d322098987132548aa64a1d78fb/lss-conflict
I (12664) sphinx_key::conn::mqtt: RECEIVED Subscribed MESSAGE
thread 'main' panicked at 'range end index 8 out of range for slice of length 0', /home/flow/.cargo/git/checkouts/sphinx-rs-3cc5315d38da0c45/7681893/signer/sr
c/kvv.rs:64:42
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
irriden commented 10 months ago

The idea now is to unplug signers at random points during the keysends.

irriden commented 10 months ago

Just reproduced, this likely is caused by unplugging the signer at a bad point in execution - and leaving the sd card with corrupted data. Restarts don't fix this problem.