Skip to content

Commit

Permalink
chore: better naming converntion
Browse files Browse the repository at this point in the history
  • Loading branch information
darshankabariya committed Jun 28, 2024
1 parent dd3ea78 commit 9dfa363
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion tests/wakunode_rest/test_rest_filter.nim
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ proc init(T: type RestFilterTest): Future[T] {.async.} =
await allFutures(testSetup.serviceNode.start(), testSetup.subscriberNode.start())

await testSetup.serviceNode.mountRelay()
await testSetup.serviceNode.mountFilter(cacheTTL = 1.seconds)
await testSetup.serviceNode.mountFilter(messageCacheTTL = 1.seconds)
await testSetup.subscriberNode.mountFilterClient()

testSetup.subscriberNode.peerManager.addServicePeer(
Expand Down
4 changes: 2 additions & 2 deletions waku/node/waku_node.nim
Original file line number Diff line number Diff line change
Expand Up @@ -437,14 +437,14 @@ proc mountFilter*(
filter_subscriptions.DefaultSubscriptionTimeToLiveSec,
maxFilterPeers: uint32 = filter_subscriptions.MaxFilterPeers,
maxFilterCriteriaPerPeer: uint32 = filter_subscriptions.MaxFilterCriteriaPerPeer,
cacheTTL: Duration = 2.minutes,
messageCacheTTL: Duration = filter_subscriptions.MessageCacheTTL,
) {.async: (raises: []).} =
## Mounting filter v2 protocol

info "mounting filter protocol"
node.wakuFilter = WakuFilter.new(
node.peerManager, subscriptionTimeout, maxFilterPeers, maxFilterCriteriaPerPeer,
cacheTTL,
messageCacheTTL,
)

if node.started:
Expand Down
4 changes: 2 additions & 2 deletions waku/waku_filter_v2/protocol.nim
Original file line number Diff line number Diff line change
Expand Up @@ -298,14 +298,14 @@ proc new*(
subscriptionTimeout: Duration = DefaultSubscriptionTimeToLiveSec,
maxFilterPeers: uint32 = MaxFilterPeers,
maxFilterCriteriaPerPeer: uint32 = MaxFilterCriteriaPerPeer,
cacheTTL: Duration = 2.minutes,
messageCacheTTL: Duration = MessageCacheTTL,
): T =
let wf = WakuFilter(
subscriptions: FilterSubscriptions.init(
subscriptionTimeout, maxFilterPeers, maxFilterCriteriaPerPeer
),
peerManager: peerManager,
messageCache: init(TimedCache[string], cacheTTL),
messageCache: init(TimedCache[string], messageCacheTTL),
)

wf.initProtocolHandler()
Expand Down
1 change: 1 addition & 0 deletions waku/waku_filter_v2/subscriptions.nim
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const
MaxFilterPeers* = 1000
MaxFilterCriteriaPerPeer* = 1000
DefaultSubscriptionTimeToLiveSec* = 5.minutes
MessageCacheTTL* = 2.minutes

type
# a single filter criterion is fully defined by a pubsub topic and content topic
Expand Down

0 comments on commit 9dfa363

Please sign in to comment.