You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: meter SendService transmissions through RateLimitManager
Wires the relocated RateLimitManager into the messaging layer at the
transmission stage rather than the API entry point:
- MessagingClientConf gains a rateLimit: RateLimitConfig field
(defaulting to DefaultEpochPeriodSec / DefaultMessagesPerEpoch), and
MessagingClient.new hands the constructed manager to SendService.
- SendService consults admit() before the first transmission of a
task, both in send() and in the retry loop. Re-publishes of an
already-propagated message (firstPropagatedTime set) skip admission:
they resend the same bytes, which reuse the same RLN proof/nullifier
and consume no fresh epoch slot.
- An over-budget task parks in the task cache as NextRoundRetry; the
service loop re-admits it as the epoch budget frees up. The skeleton
admit() is a pass-through, so behaviour is unchanged today.
Gating transmissions instead of MessagingClient.send keeps SDS repair
rebroadcasts free of API-entry rejection (SDS decides that a repair is
needed; the transmission scheduler decides when it fits the budget)
while every wire transmission still draws from one node-wide budget --
which network-side RLN enforcement applies to repairs regardless of
any local bypass. It is also where RLN proof attachment must happen,
since proofs bind to the epoch current at transmission time.
Adds tests/messaging/test_rate_limit_manager.nim covering the current
disabled + enabled pass-through behaviour, wired into
all_tests_waku.nim.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
0 commit comments