Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions .claude/skills/rust-style/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,25 @@ let x = a.checked_add(b).ok_or(Error::Overflow)?;

## Casts

No lossy or unchecked casts — use fallible conversions:
**Never use `as` for numeric type conversions** — use fallible conversions with `try_from`:

```rust
// Bad
// Bad - will cause clippy errors
let x = value as u32;
let y = some_usize as u64;

// Good
// Good - use try_from with proper error handling
let x = u32::try_from(value)?;
let y = u64::try_from(some_usize).expect("message explaining why this is safe");
```

Rules:

- Always use `TryFrom`/`try_from` for numeric conversions between different types
- Handle conversion failures explicitly (either with `?` or `expect` with justification)
- The only acceptable use of `expect` is when the conversion is guaranteed to succeed (e.g., `usize` to `u64` on 64-bit platforms)
- Clippy will error on unchecked `as` casts: `cast_possible_truncation`, `cast_possible_wrap`, `cast_sign_loss`

---

## Async / Tokio
Expand Down
8 changes: 8 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions crates/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,13 @@ humantime.workspace = true
tokio.workspace = true
pluto-app.workspace = true
pluto-cluster.workspace = true
pluto-crypto.workspace = true
pluto-relay-server.workspace = true
pluto-tracing.workspace = true
pluto-core.workspace = true
pluto-p2p.workspace = true
pluto-eth1wrap.workspace = true
pluto-eth2api.workspace = true
pluto-eth2util.workspace = true
pluto-k1util.workspace = true
pluto-ssz.workspace = true
Expand All @@ -35,6 +38,11 @@ serde_with = { workspace = true, features = ["base64"] }
rand.workspace = true
tempfile.workspace = true
reqwest.workspace = true
url.workspace = true
chrono.workspace = true
uuid.workspace = true
flate2.workspace = true
tar.workspace = true

[dev-dependencies]
tempfile.workspace = true
Expand Down
9 changes: 8 additions & 1 deletion crates/cli/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
use clap::{Parser, Subcommand};

use crate::commands::{
create_cluster::CreateClusterArgs,
create_enr::CreateEnrArgs,
enr::EnrArgs,
relay::RelayArgs,
Expand Down Expand Up @@ -40,7 +41,7 @@ pub enum Commands {
about = "Create artifacts for a distributed validator cluster",
long_about = "Create artifacts for a distributed validator cluster. These commands can be used to facilitate the creation of a distributed validator cluster between a group of operators by performing a distributed key generation ceremony, or they can be used to create a local cluster for single operator use cases."
)]
Create(CreateArgs),
Create(Box<CreateArgs>),

#[command(about = "Print version and exit", long_about = "Output version info")]
Version(VersionArgs),
Expand Down Expand Up @@ -135,4 +136,10 @@ pub enum CreateCommands {
/// Create an Ethereum Node Record (ENR) private key to identify this charon
/// client
Enr(CreateEnrArgs),

#[command(
about = "Create private keys and configuration files needed to run a distributed validator cluster locally",
long_about = "Creates a local charon cluster configuration including validator keys, charon p2p keys, cluster-lock.json and deposit-data.json file(s). See flags for supported features."
)]
Cluster(Box<CreateClusterArgs>),
}
Loading
Loading