Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion logos_delivery/api/conf/messaging_conf.nim
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ import results, libp2p/crypto/crypto
import logos_delivery/api/conf/kernel_conf
import logos_delivery/waku/common/logging
import logos_delivery/waku/factory/networks_config
import logos_delivery/messaging/rate_limit_manager/rate_limit_manager

export kernel_conf
export kernel_conf, rate_limit_manager

type LogosDeliveryMode* {.pure.} = enum
Edge # client-only node
Expand Down Expand Up @@ -52,6 +53,9 @@ type MessagingClientConf* = object
## Process log format (TEXT or JSON); applied by the kernel on node creation.
nodeKey* {.name: "nodekey".}: Opt[crypto.PrivateKey]
## P2P node private key (64-char hex): stable identity / peerId across restarts.
rateLimit*: RateLimitConfig = RateLimitConfig(
epochPeriodSec: DefaultEpochPeriodSec, messagesPerEpoch: DefaultMessagesPerEpoch
) ## RLN-epoch transmission budget enforced by the send service.

proc applyMode*(conf: var WakuNodeConf, mode: LogosDeliveryMode): ConfResult[void] =
## Sets the protocol flags implied by the mode.
Expand Down
10 changes: 0 additions & 10 deletions logos_delivery/channels/api/channel_lifecycle.nim
Original file line number Diff line number Diff line change
Expand Up @@ -51,23 +51,13 @@ proc createReliableChannel*(
causalHistorySize: cc.sdsCausalHistorySize.get(DefaultCausalHistorySize),
persistence: sdsPersistence(),
)
let rateConfig = RateLimitConfig(
# Setting a rate-limit parameter implies enabling; an explicit
# rateLimitEnabled still wins.
enabled: cc.rateLimitEnabled.get(
cc.rateLimitEpochPeriodSec.isSome() or cc.rateLimitMessagesPerEpoch.isSome()
),
epochPeriodSec: cc.rateLimitEpochPeriodSec.get(DefaultEpochPeriodSec),
messagesPerEpoch: cc.rateLimitMessagesPerEpoch.get(DefaultMessagesPerEpoch),
)

let chn = ReliableChannel.new(
channelId = channelId,
contentTopic = contentTopic,
senderId = senderId,
segConfig = segConfig,
sdsConfig = sdsConfig,
rateConfig = rateConfig,
brokerCtx = self.brokerCtx,
)

Expand Down
2 changes: 1 addition & 1 deletion logos_delivery/channels/api/send.nim
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ proc send*(
): Future[Result[RequestId, string]] {.async: (raises: []).} =
## Spec-level entry point. Looks the channel up by id and delegates
## to `ReliableChannel.send`, which exposes the visible pipeline
## segmentation -> sds -> rate_limit_manager -> encryption.
## segmentation -> sds -> encryption -> dispatch.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
## segmentation -> sds -> encryption -> dispatch.
## segmentation -> sds -> encryption -> rate_limit_manager.

let chn = self.channels.getOrDefault(channelId)
if chn.isNil():
return err("unknown channel: " & channelId)
Expand Down
80 changes: 0 additions & 80 deletions logos_delivery/channels/rate_limit_manager/rate_limit_manager.nim

This file was deleted.

Loading
Loading