entropyxyz / entropy-core

Protocol and cryptography development.
https://docs.entropy.xyz/
GNU Affero General Public License v3.0
11 stars 2 forks source link

Avoid panic by checking that we have a non-signing validator before selecting one #1083

Closed ameba23 closed 1 month ago

ameba23 commented 1 month ago

Ahead of us making a release i wanted to try out our current setup with docker-compose. I should have known it was not going to work with the relaying because we have 3 nodes and all are signers - so there is no-one to be a relayer for our signature requests.

This is what happens when we try to sign:

~/r/s/e/e/c/test-cli (master●●)[130] $ cargo run --release -- sign -m //Alice 0380b55a941d514baf9e5c4b96239cda40c1854f83919262029bdfec340aed4c13 'heysdlafkjsdlfkj'
    Finished `release` profile [optimized] target(s) in 0.51s
     Running `/home/turnip/radish/src/entropy/entropy-core/target/release/entropy-test-cli sign -m //Alice 0380b55a941d514baf9e5c4b96239cda40c1854f83919262029bdfec340aed4c13 heysdlafkjsdlfkj`
User account for current call: 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY
thread 'main' panicked at /home/turnip/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rand-0.8.5/src/rng.rs:134:9:
cannot sample empty range

entropy-client::sign panics, rather than returning an error. This fixes that.