chore(rln-relay): barrel imports (#1386)

Co-authored-by: s1fr0 <28568419+s1fr0@users.noreply.github.com>
Co-authored-by: Lorenzo Delgado <lorenzo@status.im>
This commit is contained in:
Aaryamann Challani 2022-11-21 19:45:03 +05:30 committed by GitHub
parent 59c18ab5c4
commit 853995e17f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
17 changed files with 35 additions and 27 deletions

View File

@ -38,7 +38,7 @@ when defined(rln):
import
libp2p/protocols/pubsub/rpc/messages,
libp2p/protocols/pubsub/pubsub,
../../waku/v2/protocol/waku_rln_relay/waku_rln_relay_utils
../../waku/v2/protocol/waku_rln_relay
const Help = """
Commands: /[?|help|connect|nick|exit]

View File

@ -47,8 +47,7 @@ import
when defined(rln):
import
../../waku/v2/protocol/waku_rln_relay/waku_rln_relay_types,
../../waku/v2/protocol/waku_rln_relay/waku_rln_relay_utils
../../waku/v2/protocol/waku_rln_relay
logScope:

View File

@ -133,7 +133,7 @@ The numerical value `165886530` indicates the epoch of the message `Hi`.
You will see a different value than `165886530` on your screen.
If two messages sent by the same chat2 client happen to have the same RLN epoch value, then one of them will be detected as spam and won't be routed (by test fleets in this test setting).
At the time of this tutorial, the epoch duration is set to `10` seconds.
You can inspect the current epoch value by checking the following [constant variable](https://github.com/status-im/nim-waku/blob/21cac6d491a6d995a7a8ba84c85fecc7817b3d8b/waku/v2/protocol/waku_rln_relay/waku_rln_relay_types.nim#L119) in the nim-waku codebase.
You can inspect the current epoch value by checking the following [constant variable](https://github.com/status-im/nim-waku/blob/21cac6d491a6d995a7a8ba84c85fecc7817b3d8b/waku/v2/protocol/waku_rln_relay/constants.nim#L245) in the nim-waku codebase.
Thus, if you send two messages less than `10` seconds apart, they are likely to get the same `rln epoch` values.
After sending a chat message, you may experience some delay before the next chat prompt appears.

View File

@ -7,7 +7,7 @@ Spam detection takes place at the chat2 users end.
In this setting, you should try to spam the network by violating the message rate limit i.e.,
sending more than one message per epoch.
At the time of this tutorial, the epoch duration is set to `10` seconds.
You can inspect the current epoch value by checking the following [constant variable](https://github.com/status-im/nim-waku/blob/21cac6d491a6d995a7a8ba84c85fecc7817b3d8b/waku/v2/protocol/waku_rln_relay/waku_rln_relay_types.nim#L119) in the nim-waku codebase.
You can inspect the current epoch value by checking the following [constant variable](https://github.com/status-im/nim-waku/blob/21cac6d491a6d995a7a8ba84c85fecc7817b3d8b/waku/v2/protocol/waku_rln_relay/constants.nim#L245) in the nim-waku codebase.
Your messages will be routed via test fleets and will arrive at other live chat2 clients that are running in rate-limited mode over the same content topic i.e., `/toy-chat/2/luzhou/proto`.
Your samp activity will be detected by them and a proper message will be shown on their console.

View File

@ -7,7 +7,7 @@ For ease of explanation, we will refer to them as `Alice`, `Bob`, and `Carol`.
In this setting, if `Bob` or `Carol` attempts to spam the network by violating the message rate limit then `Alice` will detect their spamming activity, and does not relay the spam messages.
The message rate is one per epoch.
At the time of this tutorial, the epoch duration is set to `10` seconds.
You can inspect its current value by checking the following [constant variable](https://github.com/status-im/nim-waku/blob/21cac6d491a6d995a7a8ba84c85fecc7817b3d8b/waku/v2/protocol/waku_rln_relay/waku_rln_relay_types.nim#L119) in the nim-waku codebase.
You can inspect its current value by checking the following [constant variable](https://github.com/status-im/nim-waku/blob/21cac6d491a6d995a7a8ba84c85fecc7817b3d8b/waku/v2/protocol/waku_rln_relay/constants.nim#L245) in the nim-waku codebase.
# Set up

View File

@ -13,11 +13,7 @@ import
import
../../waku/v2/node/waku_node,
../../waku/v2/protocol/waku_message,
../../waku/v2/protocol/waku_rln_relay/rln,
../../waku/v2/protocol/waku_rln_relay/waku_rln_relay_utils,
../../waku/v2/protocol/waku_rln_relay/waku_rln_relay_types,
../../waku/v2/protocol/waku_rln_relay/waku_rln_relay_constants,
../../waku/v2/protocol/waku_rln_relay/waku_rln_relay_metrics,
../../waku/v2/protocol/waku_rln_relay,
../test_helpers
const RlnRelayPubsubTopic = "waku/2/rlnrelay/proto"

View File

@ -8,9 +8,9 @@ import
stew/byteutils, stew/shims/net as stewNet,
libp2p/crypto/crypto,
eth/keys,
../../waku/v2/protocol/waku_rln_relay/[waku_rln_relay_utils,
waku_rln_relay_constants,
waku_rln_relay_types,
../../waku/v2/protocol/waku_rln_relay/[utils,
constants,
protocol_types,
rln_relay_contract],
../../waku/v2/node/waku_node,
../test_helpers,

View File

@ -17,9 +17,7 @@ import
import
../../waku/v2/node/waku_node,
../../waku/v2/protocol/waku_message,
../../waku/v2/protocol/waku_rln_relay/waku_rln_relay_utils,
../../waku/v2/protocol/waku_rln_relay/waku_rln_relay_types,
../../waku/v2/protocol/waku_rln_relay/waku_rln_relay_constants,
../../waku/v2/protocol/waku_rln_relay,
../../waku/v2/utils/peers
from std/times import epochTime

View File

@ -17,7 +17,7 @@ import
./waku_node
when defined(rln):
import ../protocol/waku_rln_relay/waku_rln_relay_metrics
import ../protocol/waku_rln_relay/protocol_metrics as rln_metrics
const LogInterval = 30.seconds

View File

@ -44,7 +44,7 @@ import
when defined(rln):
import
../protocol/waku_rln_relay/waku_rln_relay_types
../protocol/waku_rln_relay/protocol_types
declarePublicGauge waku_version, "Waku version info (in git describe format)", ["version"]
declarePublicCounter waku_node_messages, "number of messages received", ["type"]

View File

@ -17,7 +17,7 @@ import
when defined(rln):
import
./waku_rln_relay/waku_rln_relay_types
./waku_rln_relay/protocol_types
const MaxWakuMessageSize* = 1024 * 1024 # In bytes. Corresponds to PubSub default

View File

@ -0,0 +1,13 @@
import
./waku_rln_relay/rln,
./waku_rln_relay/constants,
./waku_rln_relay/protocol_types,
./waku_rln_relay/protocol_metrics,
./waku_rln_relay/utils
export
rln,
constants,
protocol_types,
protocol_metrics,
utils

View File

@ -8,7 +8,7 @@ import
chronos,
metrics,
metrics/chronos_httpserver,
waku_rln_relay_constants,
./constants,
../../utils/collector
export metrics

View File

@ -7,7 +7,7 @@ else:
import
os,
waku_rln_relay_types
./protocol_types
const libPath = "vendor/zerokit/target/release/"

View File

@ -14,11 +14,13 @@ import
libp2p/protocols/pubsub/rpc/messages,
libp2p/protocols/pubsub/pubsub,
stew/results,
stew/[byteutils, arrayops, endians2],
rln,
waku_rln_relay_constants,
waku_rln_relay_types,
waku_rln_relay_metrics,
stew/[byteutils, arrayops, endians2]
import
./rln,
./constants,
./protocol_types,
./protocol_metrics
import
../../utils/time,
../../utils/keyfile,
../../node/waku_node,