-
Notifications
You must be signed in to change notification settings - Fork 117
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
HAL-06 iteration over map source of non-determinism #3257
Comments
I don't agree with the report for the issue. Map is not determistic, but if use the same map realization and the same order of updates, then the result should be same. If we use the vector as suggested, it will be no efficient for date fetch. I suggest we won't fix it. |
close it if one more person agree with no fix. @banshee @smartyalgo @Brando753 |
I disagree, this may still be an issue, a version of sifnode compiled with a different version of go could result in map iteration being different. We should not assume the order would be the same just because updates are made the same. I say we should huddle on this. |
After discuss with @smartyalgo , we think it is an issue, we should avoid using the map in keeper. will fix it. |
unit + integration tests modified and finished. PR awaiting review. |
@Brando753 to review PR |
@banshee reviewing. ETA next week. |
According to Michael: James is reorganizing solution to use keepers instead of maps. |
@juniuszhou to check with @banshee to see if he's currently working on a PR |
@juniuszhou to check in with James |
Description
The codebase contains instances of iteration over maps. As maps are not ordered in Go, iterations over maps are non-deterministic. If the consensus logic expects a deterministic result from the iteration, errors can occur where different nodes reach different states due to the differences in map ordering. If the nodes reach differing states, this can cause consensus issues, which could result in a chain halt.
Code Location:
Recommendation
Ensure that iterations over maps do not contain any logic that depends on a fixed ordering of the map. Alternatively, make use of an alternative data structure that has a deterministic ordering or ensure that maps are sorted before iterating over them.
The text was updated successfully, but these errors were encountered: