Repository navigation
Conversation
isConfirmed summed the Weight snapshots stored in ConfirmedOwner when each owner confirmed. Owner add/del/modify/replace operations never invalidate those snapshots, so after an owner is removed or demoted their stale confirmation still counts at the old weight and a pending transfer can reach the threshold with approvals the current owner set no longer supports. Behind ForkMultiSigFixStaleWeight, isConfirmed now re-reads each confirming owner's current weight from the multisig account and skips owners that have been removed. The pre-fork path keeps the old snapshot logic for consensus compatibility. Add a unit test covering removed and demoted owners.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题
isConfirmed累加的是确认时写入ConfirmedOwner的权重快照,而 owner 的 add/del/modify/replace 不会回头修正已存在的确认。因此 owner 被删除或降权后,其历史确认仍按旧权重计入阈值:一笔在 owner 变更前未达阈值的 pending 转账,可以在 owner 集合变更后“凑够”阈值被执行,即使用了当前 owner 集合并未授权的旧确认。典型场景:多签成员密钥泄露,其余 owner 将其移出/降权后,该成员此前对某笔转账的确认仍然有效。
修复
isConfirmed增加multiSigAcc与useCurWeight参数;ForkMultiSigFixStaleWeight生效后按当前 owner 列表重新取权重,已删除 owner 直接跳过。MultiSigConfirmTx、executeTransferTx、executeAccOperateTx、executeOwnerOperateTx全部走新逻辑。验证
go build ./plugin/dapp/multisig/...通过go test ./plugin/dapp/multisig/executor/ -count=1通过