Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Oct 1, 2024

Conversation

ameba23
Copy link
Contributor

@ameba23 ameba23 commented Oct 1, 2024

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.

@ameba23 ameba23 self-assigned this Oct 1, 2024
@@ -96,8 +96,6 @@ pub enum ClientError {
TryFromSlice(#[from] std::array::TryFromSliceError),
#[error("User is not registered on-chain")]
NotRegistered,
#[error("No synced validators")]
NoSyncedValidators,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated to this PR but i think we don't use this anymore

@HCastano HCastano changed the title entropy-client - avoid panic by checking that we have a non-signing validator before selecting one Avoid panic by checking that we have a non-signing validator before selecting one Oct 1, 2024
@HCastano HCastano merged commit 4af5c9e into master Oct 1, 2024
7 of 8 checks passed
@HCastano HCastano deleted the peg/client-check-non-signing-validator branch October 1, 2024 21:53
ameba23 added a commit that referenced this pull request Oct 2, 2024
* master:
  Bump clap from 4.5.18 to 4.5.19 in the patch-dependencies group (#1091)
  Avoid panic by checking that we have a non-signing validator before selecting one (#1083)
  Fix master build (#1088)
  Small fixes to `test-cli` (#1084)
  Pregenerate keyshares sets for all possible initial signer comittees (#1073)
  Fix master build (#1079)
  Bump reqwest from 0.12.7 to 0.12.8 in the patch-dependencies group (#1082)
  Block tss chain when signer (#1078)
  Run multiple test validator (#1074)
  Bump tempfile from 3.12.0 to 3.13.0 (#1076)
  Bump axum from 0.7.6 to 0.7.7 in the patch-dependencies group (#1075)
  Unignore register and sign integration test, and do a non-mock jumpstart (#1070)
  No unbonding when signer or next signer (#1031)
  Add `/relay_tx` endpoint (#1050)
  Fix how pre-generated keyshares are added for tests (#1061)
  Handle Provisioning Certification Keys (PCKs) (#1051)
  Bump async-trait from 0.1.82 to 0.1.83 in the patch-dependencies group (#1067)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants