-
Notifications
You must be signed in to change notification settings - Fork 658
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Revocation Registry Entry update depends on the ordering of sets #1769
Comments
Behavior of this seems to have changed with python3.6 |
Great find |
Just to be sure this doesn't get forgotten, this problem is present in both revocation strategies: indy-node/indy_node/server/revocation_strategy.py Lines 140 to 144 in 1e24fc2
indy-node/indy_node/server/revocation_strategy.py Lines 198 to 202 in 1e24fc2
|
Suggestion on how to avoid a config for the issue. Can the code run the signature verifier and if it fails on a rev-reg-entry, regenerate the list to force it to "the old way", reverify the signature and accept that? That way we can move forward with the upgrade to Python and not have to have a startup parameter that says when this change went into efffect. |
Or is something that can be fixed and we could use a migration script for; https://github.com/hyperledger/indy-node/tree/main/data/migrations |
Wild -- do those scripts allow for updating transactions/signatures/roots on existing transactions? They would be able to fix this issue? |
Wouldn't we still have an issue with having incorrect state root hashes in the audit ledger breaking the state proofs? |
The migration scripts have been used for a variety of reasons in the past; data migrations, config updates, etc. |
That is another issue I realized while this happened during catchup: This happened at domain tx 843 but the node did not indicate any kind of error and went through all the domain transactions. I do believe that state root hashes are currently not verified during catchup. That is something I planned to understand this week and create a separate issue if this is correct. |
I think it's safe to close. |
This should explain the behavior from #1750.
When a revocation registry entry is received, the corresponding handler will find out the revocation registry strategy of the corresponding revocation registry and use the one of the 2 implementations provided in revocation_strategy.py:
The code below uses a set to aggregate the existing revocations with the newly added ones and converts back to a list after. This results in undefined behavior regarding ordering: A set is unordered in python and by converting a set to a list without sorting, the list will have the same order which is not guaranteed.
indy-node/indy_node/server/revocation_strategy.py
Lines 140 to 144 in 1e24fc2
I created a small test program mimicking the current implementation:
This creates different behavior depending on python implementation:
python:3.5-buster:
python:3.8-buster:
We can see that the ordering behaves differently (5,7,6 gets sorted - 8 does not)
In indy, this results in the state trie diverging and the catchup of a node using newer versions of python to fail.
The text was updated successfully, but these errors were encountered: