Skip to content
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

Potential chain selection issue related to Dictionary keys order #78

Closed
Antivortex opened this issue Mar 6, 2023 · 1 comment
Closed
Assignees
Labels
bug Something isn't working

Comments

@Antivortex
Copy link

Antivortex commented Mar 6, 2023

Hello!

This piece of code in the Engine.cs Request method implies that the keys are determenistically ordered in the dictionary and will keep same order in the array generated by ToArray() call.

var firstRequiredNamespace = sessionData.RequiredNamespaces.Keys.ToArray()[0]; defaultChainId = sessionData.RequiredNamespaces[firstRequiredNamespace].Chains[0];

However the keys order is non-determenistic in the C# dictionary and might depend on implementation. You can see more details here:

https://stackoverflow.com/questions/4007782/the-order-of-elements-in-dictionary

@gigajuwels gigajuwels self-assigned this Sep 26, 2023
@gigajuwels gigajuwels added the bug Something isn't working label Sep 26, 2023
@skibitsky skibitsky assigned skibitsky and unassigned gigajuwels Feb 22, 2024
@skibitsky
Copy link
Member

Fixed in #156

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants