rust-libp2p icon indicating copy to clipboard operation
rust-libp2p copied to clipboard

feat(gossipsub): apply `max_transmit_size` to the published message itself

Open kalabukdima opened this issue 1 year ago • 0 comments

Description

When trying to publish a message using gossipsub's publish method, it should be possible to predict whether it will fit in the limit defined by the max_transmit_size config option. If this limit applies to the final protobuf payload, it's not possible to know that in advance because the size of the added fields is not fixed.

This change makes the limit apply to the passed message size instead of the final wire size.

Notes & open questions

This is a minor version change because it changes the meaning of the existing config option. However, for the existing clients the limit will only become more permissive, so it shouldn't break anything.

Change checklist

  • [x] I have performed a self-review of my own code
  • [x] I have made corresponding changes to the documentation
  • [ ] I have added tests that prove my fix is effective or that my feature works
  • [x] A changelog entry has been made in the appropriate crates

kalabukdima avatar Oct 21 '24 09:10 kalabukdima