mirror of
https://github.com/waku-org/nwaku.git
synced 2025-01-09 14:26:27 +00:00
ed09074cc3
* message.nim: set max message size to 150KiB according to spec Using KiB instead of KB because that seems more aligned with the actual default defined in nim-libp2p (1024 * 1024) Spec details: https://rfc.vac.dev/spec/64/#message-size * test_protocol.nim: align test to current WakuMessage limit * test_waku_client.nim: adapt test to MaxWakuMessageSize change * make maxMessageSize configurable for wakunode2 * wakunode2 app now accepts max-num-bytes-msg-size with KiB, KB, or B units * testlib/wakunode.nim: set maxMessageSize: "1024 KiB" * test_waku_client.nim: remove duplicate check in "Valid Payload Sizes" * set DefaultMaxWakuMessageSizeStr as the only source of truth * external_config.nim: rename max-num-bytes-msg-size -> max-msg-size
39 lines
1.1 KiB
Nim
39 lines
1.1 KiB
Nim
## Waku Message module.
|
|
##
|
|
## See https://github.com/vacp2p/specs/blob/master/specs/waku/v2/waku-message.md
|
|
## for spec.
|
|
|
|
when (NimMajor, NimMinor) < (1, 4):
|
|
{.push raises: [Defect].}
|
|
else:
|
|
{.push raises: [].}
|
|
|
|
|
|
import
|
|
../topics,
|
|
../time,
|
|
./default_values
|
|
|
|
const
|
|
MaxMetaAttrLength* = 64 # 64 bytes
|
|
|
|
type WakuMessage* = object
|
|
# Data payload transmitted.
|
|
payload*: seq[byte]
|
|
# String identifier that can be used for content-based filtering.
|
|
contentTopic*: ContentTopic
|
|
# Application specific metadata.
|
|
meta*: seq[byte]
|
|
# Number to discriminate different types of payload encryption.
|
|
# Compatibility with Whisper/WakuV1.
|
|
version*: uint32
|
|
# Sender generated timestamp.
|
|
timestamp*: Timestamp
|
|
# The ephemeral attribute indicates signifies the transient nature of the
|
|
# message (if the message should be stored).
|
|
ephemeral*: bool
|
|
# Part of RFC 17: https://rfc.vac.dev/spec/17/
|
|
# The proof attribute indicates that the message is not spam. This
|
|
# attribute will be used in the rln-relay protocol.
|
|
proof*: seq[byte]
|