-
Notifications
You must be signed in to change notification settings - Fork 23
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
Eliminate confusion on party vs participant indices #11
Comments
This crate looks promising: typed_index_collections - Rust. The author even lists competing crates---classy! |
@sdaveas as a first step in refactoring perhaps you can start thinking about this issue. I have a few ideas so let's keep in close contact. Some rough notes from 2021-04-28:
|
Looking ahead, I'd like our solution to this issue to also do the following:
For item 2: The vision is as follows. In each protocol round I'd like to have access to two iterators:
These iterators should have access to all relevant data. eg. as It's not clear to me whether this is a realistic goal. Perhaps any solution would require lots of cruft and mem copy just to prepare the iterator, in which case it might not be worth the effort. |
Fixed with the recent refactoring. See https://github.com/axelarnetwork/tofn/blob/27f567864db6836b6df704d4b9fb82066678759d/src/collections/typed_usize.rs |
Confusion between "party" and "participant" indices is a consistent source of bugs.
eg.
participant_indices[my_participant_index] == my_secret_key_share.my_index
Suggestion
Use the newtype pattern to wrap
usize
for party vs participant indicesYou'll probably need a special collection type for each of party, participant index types that's basically a
Vec
that can be indexed by the index type instead ofusize
.The text was updated successfully, but these errors were encountered: