`network settings` outputs `frozen_ledger_keys` and `freeze_bypass_txs`, which can't be used in a `ConfigUpgradeSet`

未关闭 适合新手
#2,887 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
72/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
rust
领域
cli

调研方向

从 cmd/soroban-cli/src/commands/network/settings.rs 开始,重点查看决定包含哪些 ConfigSettingId 值的 match。检查 --internal 如何控制不可升级的设置,并参考 issue 中描述的 CAP-77 行为。更新选择逻辑,使输出可用作 ConfigUpgradeSet,然后验证默认输出中排除了 frozen_ledger_keys 和 freeze_bypass_txs。

由索引模型根据 Issue 内容生成。

描述

bug
What version are you using?

stellar-cli 30.0.1 (the relevant code is the same in 28.1.0).

What did you do?

I fetched testnet's config settings so that I could apply them to a local network as a config upgrade, which is what quickstart does to keep its local network's limits in sync with testnet:

stellar network settings --network testnet --output json \
  | jq -r '.updated_entry[] | keys[0]'
What did you expect to see?

Only the settings that a config upgrade can set. The --output help describes the output as the ConfigUpgradeSet XDR type, and settings that can't be upgraded (live_soroban_state_size_window, eviction_iterator) are already left out unless --internal is given, so I expected the output to be usable as a ConfigUpgradeSet as is.

What did you see instead?

The output also includes frozen_ledger_keys and freeze_bypass_txs. CAP-77 says these can't be upgraded by the regular mechanism that overwrites the whole entry, only through their frozen_ledger_keys_delta and freeze_bypass_txs_delta settings, so stellar-core rejects a ConfigUpgradeSet that contains them.

Quickstart works around this by stripping them out with jq before encoding the ConfigUpgradeSet: https://github.com/stellar/quickstart/blob/cb64aee580f1589c79264a98eaad839628074cd8/.scripts/update-config-settings#L56-L60

Thoughts

The command chooses which settings to fetch in cmd/soroban-cli/src/commands/network/settings.rs, and only LiveSorobanStateSizeWindow and EvictionIterator are gated behind --internal. Every other ConfigSettingId falls through to a catch-all arm whose comment says "All other configs can be modified by network upgrades and are always output": https://github.com/stellar/stellar-cli/blob/f2a7b74175c34585f3b30a1abf42a2d41cbcc390/cmd/soroban-cli/src/commands/network/settings.rs#L84-L91

The CAP-77 settings presumably landed in the catch-all when they were added to the XDR, so they're output even though that comment doesn't hold for them. Perhaps they could be treated the same as the other non-upgradeable settings and only output with --internal. Replacing the catch-all with an explicit match over every variant might also be worth considering, so that each setting added in a future protocol needs a decision about whether it can be upgraded.

主要语言
Rust
星标
129
派生
153
平均合并
1 天 14 小时
30 天内合并 PR
11

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

stellar/stellar-cli 的其他 Issue

查看 stellar/stellar-cli 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。