axelarnetwork / tofn

A threshold cryptography library in Rust
Apache License 2.0
112 stars 23 forks source link

How best to check validity of p2p messages? #134

Closed ggutoski closed 3 years ago

ggutoski commented 3 years ago

yes. Any peer that does not send either all happy or all sad p2ps is a faulter. Unfortunately, it seems we need another round of complaints here, since parties do not check other parties' p2ps by default. Need a better solution.

_Originally posted by @ggutoski in https://github.com/axelarnetwork/tofn/pull/93#discussion_r674572244_

milapsheth commented 3 years ago

I think each peer should check all other peer's P2p messages every time just to make sure they're of the same type. Since these are not crypto operations (like verifying zkps), it shouldn't have a significant performance impact. Also, adding another sad round can make this problem recursive, where the next complaint round might also allow happy and sad P2ps.

ggutoski commented 3 years ago

Yep. At some point we must bite the bullet and do a quadratic amount of work. I'm closing this issue but now we have the discussion for the historical record. 😛

ggutoski commented 3 years ago

Another option is to enforce all-happy or all-sad at compile time. But this option would require a significant change to the implementer API and Executer trait. It's not obvious how to specify a generic enum over HoleVecMaps in Rust.