critical fix: #378 calculate ondex from prior est evt, not proposed one#379
Merged
kentbull merged 9 commits intoMay 26, 2026
Merged
Conversation
Signed-off-by: Kent Bull <kent@kentbull.com>
Collaborator
Author
|
This also adds a fair bit of documentation to code that was poorly documented. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #379 +/- ##
=======================================
Coverage 97.53% 97.53%
=======================================
Files 1 1
Lines 325 325
Branches 24 24
=======================================
Hits 317 317
Misses 8 8 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Signed-off-by: Kent Bull <kent@kentbull.com>
Signed-off-by: Kent Bull <kent@kentbull.com>
Signed-off-by: Kent Bull <kent@kentbull.com>
iFergal
reviewed
May 12, 2026
Signed-off-by: Kent Bull <kent@kentbull.com>
kentbull
commented
May 12, 2026
Signed-off-by: Kent Bull <kent@kentbull.com>
This is cleaner Signed-off-by: Kent Bull <kent@kentbull.com>
kentbull
commented
May 12, 2026
kentbull
commented
May 12, 2026
kentbull
commented
May 12, 2026
kentbull
commented
May 12, 2026
iFergal
reviewed
May 13, 2026
Signed-off-by: Kent Bull <kent@kentbull.com>
Signed-off-by: Kent Bull <kent@kentbull.com>
iFergal
approved these changes
May 14, 2026
daidoji
approved these changes
May 26, 2026
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.
Problem
Failed multisig rotation where a new member is added and a new one is dropped during the same rotation. The root cause is the incorrect calculation of the
ondex, the index of the prior next key digest, from the proposed rotation event, fromrstatespassed in toGroupIdentifierManagerin the constructor.rstatesis for the proposed event, not the prior establishment event.Solution
Pull the
nnext keys (prerotated committed keys) from the prior establishment event and calculate theondexvalues from that rather than therstatesfrom the proposed event.Background
KERIpy validates ondexes, which are the pre-committed next key digest indexes, from the prior establishment event, not the new, proposed establishment event.
The reason we haven't hit this in the past is because all of the existing tests never swapped in a new member in the index/ondex of a prior member. We always had a clean addition of a new member and then a separate operation for the removal of the to-be-deleted member.
Essentially, we didn’t hit it because the existing tests never exercise departing-current-signer signs while absent from proposed rstates (the next set of pre-committments).
See #378 for an example rotation that reproduces this bug.