Encode fragment size with u32#622
Conversation
|
I'm not actually too happy with |
| let mut inner = Vec::new(); | ||
| let mut rng = ChaChaRng::seed_from_u64(u64::arbitrary(g)); | ||
| let crs_seed = String::arbitrary(g).into_bytes(); | ||
| let committee_size = 1; // very time consuming |
There was a problem hiding this comment.
Maybe try 1..=2 just to exercise the multi-member case?
IIRC there was an idea to be able to iterate through raw fragments in a block without copying their bodies out of a raw block, and the read implementation for |
| inner.push(DecryptedPrivateTallyProposal { | ||
| tally_result: (0..n_options.get()) | ||
| .map(|_| u64::arbitrary(g)) | ||
| .collect::<Box<[_]>>(), |
There was a problem hiding this comment.
Wow, didn't know that .collect<Box<[_]>> is a thing, cool.
There was a problem hiding this comment.
Everything that implements FromIterator is fair game for the collect combinator, so yeah.
This was related to a temporary implementation that I coded before changing it in 03e27ba. I'm reasonably happy with the current one |
eea8acf to
1033ef4
Compare
|
I've moved the |
Some large fragments (private
VoteTallywith lots of proposals/shares) can overflow the current fragment size (u16) when serializing. This PR encodes the size of aFragmentas au32to overcome such limitations.In addition, add some tests that could help detect such issues in the future:
Arbitraryfor privateVoteTally, so that we can test its ser/de implementations and stress the behavior of other parts with very large payloads.Fragment