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

Implement sort for some Maps, Sets and Vecs #100

Open
0x009922 opened this issue Apr 24, 2022 · 0 comments
Open

Implement sort for some Maps, Sets and Vecs #100

0x009922 opened this issue Apr 24, 2022 · 0 comments
Labels

Comments

@0x009922
Copy link
Contributor

0x009922 commented Apr 24, 2022

The issue is that some structs, like Signatures, are sorted. That is, no matter in what order entries are inserted in the map or set (in Rust), when the map or set is encoded, its entries are sorted using PartialEq trait. It is wise - the exact encoded form has impact on hashing and signing (which could have BTreeMap metadata, for example). The ordered encoding ensures consistent output despite the insertion order.

The problem is that the JavaScript SDK doesn't perform sorting on encoding, so, signature check failures might be thrown by Iroha if SDK users don't sort some structs content on their own.

@0x009922 0x009922 added bug iroha2 package: data model Related to Data Model package(-s) labels Apr 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants