0xMiden / 0xMiden/protocol

Sort approver public keys in multisig

未關閉
#3,280 1 則留言 1 個 reaction 已指派 0 人 在 GitHub 檢視
standards
主要語言
Rust
星號
132
分支
167
平均合併
1 天 23 小時
30 天內合併 PR
110

描述

Consider making approver public keys in the multisig sorted, so the duplicates check in `assert_unique_approver_public_keys` becomes simpler (single loop instead of double loop). Afaict, there is no reliance on approver indices in the public key array, since each approver has the same weight.

Additionally, consider refactoring `AuthMultisigConfig::with_proc_thresholds` to take procedure thresholds as `BTreeMap` rather than `Vec` which avoids the explicit duplicate check and allows moving the setter threshold check from `AuthMultisig::new` to the config, to make invalid configs unrepresentable.

Context:
- https://github.com/0xMiden/protocol/pull/3246#discussion_r3569073672
- https://github.com/0xMiden/protocol/pull/3246#discussion_r3569102219

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。