mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-12 17:41:22 +00:00
fix(gossipsub): signed messages use monotonically increasing seq numbers
This modifies the gossipsub implementation to use monotonically increasing sequence numbers for signed messages (as dictated by the specification). There is a discussion about this in #3453. This change will make rust-libp2p gossipsub align with the go-implementation when messages are signed. Messages will however still use randomized sequence numbers when messages are unsigned for security reasons (as discussed in the issue linked). This shouldn't change any user-level API, only the seqno behavior. It is fully backwards compatible. Resolves #3453. Pull-Request: #3551.
This commit is contained in:
@ -50,8 +50,9 @@
|
||||
//! - **Sequence Numbers** - A message on the gossipsub network is identified by the source
|
||||
//! [`libp2p_core::PeerId`] and a nonce (sequence number) of the message. The sequence numbers in
|
||||
//! this implementation are sent as raw bytes across the wire. They are 64-bit big-endian unsigned
|
||||
//! integers. They are chosen at random in this implementation of gossipsub, but are sequential in
|
||||
//! the current go implementation.
|
||||
//! integers. When messages are signed, they are monotonically increasing integers starting from a
|
||||
//! random value and wrapping around u64::MAX. When messages are unsigned, they are chosen at random.
|
||||
//! NOTE: These numbers are sequential in the current go implementation.
|
||||
//!
|
||||
//! # Peer Discovery
|
||||
//!
|
||||
|
Reference in New Issue
Block a user