Add `--include-costs` option to `stellar network settings` to filter verbose cost params

Open
#2,322 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
55/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Stale
Tech stack
rust
Domain
cli

Research direction

Start at the implementation of the stellar network settings command and trace how its output is assembled. Compare the default command output with --include-costs; done means both verbose cost parameter arrays are omitted by default and included in full when the flag is supplied.

Written by the indexing model from the issue text.

Description

feature request
What problem does your feature solve?

The stellar network settings command outputs the full network configuration including contract_cost_params_cpu_instructions and contract_cost_params_memory_bytes arrays. These cost params are extremely verbose (70 entries each) and make the output difficult to work with for most use cases.

This came up in https://github.com/stellar/stellar-rpc/pull/563 where there was discussion about exposing network limits through RPC's getNetwork endpoint. The consensus was to not duplicate this functionality in RPC and instead point users to the CLI command, but the CLI output needs to be more usable by filtering out the verbose cost info by default.

See:

What would you like to see?

Add a new --include-costs flag:

  • By default, exclude cost params from output
  • With --include-costs, include the full cost params arrays
What alternatives are there?

Users can currently filter the output using jq:

stellar network settings --network testnet | jq 'del(.updated_entry[].contract_cost_params_cpu_instructions, .updated_entry[].contract_cost_params_memory_bytes)'

But this is cumbersome and requires knowing the field names to filter.

Dominant language
Rust
Stars
123
Forks
141
Avg merge
2d 21h
Merged PRs (30d)
17

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from stellar/stellar-cli

All issues in stellar/stellar-cli

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.