Skip to content
Merged
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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ All notable changes to this project will be documented in this file.

- SDK (Rust)
- Drop the pre-submit `simulate_transaction` call in `DZClient::execute_transaction_inner` and submit with `skip_preflight: true`, eliminating the redundant double-simulation (the explicit simulate plus `send_and_confirm_transaction`'s default preflight) on the happy path. Program logs are now recovered from `get_transaction` on the failure path so `SimulationError` / `SimulationTransactionError` and `DoubleZeroError` mapping in CLI output are unchanged. Trade-off: failing transactions now land onchain and burn fees instead of failing for free at simulation ([#3750](https://github.com/malbeclabs/doublezero/pull/3750))
- CLI
- Restore the default value for `doublezero device interface create --bandwidth` so it is optional again. [#3077](https://github.com/malbeclabs/doublezero/pull/3077) dropped `default_value` from the clap attribute on `bandwidth`; because the field is `u64` (not `Option<u64>`), clap then treated omission as a missing required argument, even though the PR description stated `--bandwidth` was now optional ([#3775](https://github.com/malbeclabs/doublezero/pull/3775))
- e2e/qa: remove client-side capacity pre-filtering from `ValidDevices`, because the QA user pubkey bypasses capacity limits using the serviceability global-config qa-allowlist. Individual device failures no longer fail the test; instead, overall and per-host failure rates are evaluated after all batches and the test only fails if either exceeds `--failure-threshold` (default 10%) or `--per-host-failure-threshold` (default 20%).
- CLI
- Add `--solana-url <SOLANA_RPC_URL>` global flag to `doublezero` per RFC-20 §Global flags. Distinct from `--url`, which continues to override the DZ ledger transport; `--solana-url` targets the Solana L1 transport. The flag is parsed and exposed on the binary's `App` struct; per-verb consumption lands when verbs migrate to construct typed Solana L1 clients from `CliContext`.
Expand Down
34 changes: 33 additions & 1 deletion smartcontract/cli/src/device/interface/create.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ pub struct CreateDeviceInterfaceCliCommand {
#[arg(long)]
pub ip_net: Option<NetworkV4>,
/// Bandwidth. Accepts values in Kbps, Mbps, or Gbps.
#[arg(long, value_parser = validate_parse_bandwidth)]
#[arg(long, value_parser = validate_parse_bandwidth, default_value = "0bps")]
pub bandwidth: u64,
/// Committed Information Rate. Accepts values in Kbps, Mbps, or Gbps.
#[arg(long, value_parser = validate_parse_bandwidth, default_value = "0bps")]
Expand Down Expand Up @@ -550,4 +550,36 @@ mod tests {
"CYOA/DIA interfaces must have MTU of 1500"
);
}

#[test]
fn test_cli_device_interface_create_bandwidth_is_optional() {
use clap::Parser;

#[derive(Parser, Debug)]
struct TestCli {
#[command(subcommand)]
command: TestCommand,
}

#[derive(clap::Subcommand, Debug)]
enum TestCommand {
Create(CreateDeviceInterfaceCliCommand),
}

let device_pk = Pubkey::new_unique().to_string();
let args = vec!["test", "create", device_pk.as_str(), "Loopback0"];

let result = TestCli::try_parse_from(args);
assert!(
result.is_ok(),
"expected --bandwidth to be optional, but parsing failed: {:?}",
result.err()
);

let TestCli {
command: TestCommand::Create(cmd),
} = result.unwrap();
assert_eq!(cmd.bandwidth, 0, "bandwidth should default to 0");
assert_eq!(cmd.cir, 0, "cir should default to 0");
}
}
Loading