nwaku/waku/waku_rln_relay/constants.nim

59 lines
2.6 MiB
Nim
Raw Normal View History

import
stint
import
../waku_keystore
# Acceptable roots for merkle root validation of incoming messages
const AcceptableRootWindowSize* = 5
# RLN membership key and index files path
const
RlnCredentialsFilename* = "rlnCredentials.txt"
# inputs of the membership contract constructor
# TODO may be able to make these constants private and put them inside the waku_rln_relay_utils
const
MembershipFee* = 1000000000000000.u256
# the current implementation of the rln lib supports a circuit for Merkle tree with depth 20
MerkleTreeDepth* = 20
EthClient* = "ws://127.0.0.1:8540"
const
# the size of poseidon hash output in bits
HashBitSize* = 256
# the size of poseidon hash output as the number hex digits
HashHexSize* = int(HashBitSize/4)
const
DefaultRlnTreePath* = "rln_tree.db"
# temporary variables to test waku-rln-relay performance in the static group mode
const
StaticGroupSize* = 10000
# StaticGroupKeys is a static list of 10000 membership keys in the form of (identity key, identity commitment)
# keys are created locally, using createMembershipList proc from waku_rln_relay_utils module, and the results are hardcoded in here
# this list is temporary and is created to test the performance of waku-rln-relay for the static groups
# in the later versions, this static hardcoded group will be replaced with a dynamic one
const
StaticGroupKeys* = @[("23904f74b07209db3258de20e981b4564b587b238a5d259ba08329b4f84bc68c", "294993a5e2720d8e85ddbe69c45245fdb974de3b7e62be0a4147f5de75c83059", "12aebd3f304d8a036734f390549fef01316f754e480bb37a37bbafc0b051e617", "197895d5b16d7f654f030d102ebcc3261df296c0b6e37061d62f7410cff524f4"), ("1316ebb9f814050fd695ab397e8c3b45822fe71aa6127a254a8d63e2f8783567", "0f52affeafe65be040a28639cc694d5841da2c8c5edc4167271e3f813c30f4e0", "2b5c57f5ae378e6b88eec4e608b07b6e9c654f617381da7f6a40592499d26601", "11f6c80e258b238e9a90a9130f96e4ada309e269fe29512152cc1e1d8bf53d68"), ("15001a2556ba1054ebb98cdaa342882c4a0523fec8152a1ce04abda7f7e42098", "0cb912f5e88a64e0902019610c04162cadb0d6b495061c5e84fe2fe618c276c9", "274a05f36f6feda6b1ee654831d4132cd71e80bb07a875e34ee689d8925ab8c1", "24e7e253cb3a8c098b68d4b97838113c8218aedbcc0b175eb603db873e6cb72c"), ("03f7d0262a0010ad7efaea3b44a16966c427f0ff3ee601a6703e8c90915b3c7e", "2c72f97ee08a7d9c735775671e327cc52fa5bc439d4e51516f0bca5642e0b30b", "128c206de7e2f168af2fcf32af1483a311a9968cd74d6c29c639cea884375da7", "1285b0cfafc26e0ed52a0cefbdb400d19fe51455f3d594ce2460a10ebec24ffb"), ("279af6e7873cf346f3f62fef56e074a820feae108298381cfce0923be9615ade", "0faf7354c0ca795715a2a8bc723ac53407e01cf39f3f83163224d03616dfafe4", "191830dc3e240f5b95bbc81b27dbc38999b127c3d05ba3bfd6ade8422b9ddfd0", "1ac88928c8aba50df550cf11630c942dffcd4ff0af8da57124c9a605d911f068"), ("09e30ccc3cf5ccbf678131d0ab5acac6927b68bc12d56ac5a8bae57bb161b9f6", "24bda83f8ef4bc85e2b994638f87befaab0bfca13a855225df220e605bb96bc5", "19cd638d603d29b32b9e7e8e49e497e7a0c2f2145867260b65a476ba8c8a2de8", "150de9c39b53d6e872ff3017d1d7f0d4a4f470ebe413185b954304edbb6fd4e1"), ("03145b8600d35a7bd2719d693828f8da60ca98b2067571d9d6f0e7b73f3bfa33", "2c6a2a711c6f8b27583dccb711c314fb2fb513c2adc0b151d2feb46ff35a7611", "2435fc1c5694b26bffe9be63037e3cadffa84a49bc0947ae3a758059ee213885", "1316478feed4e70b467a3f38cc52b4635f372d917dec300df3c42ab934af6f9e"), ("282f621d99dcac331f95fbbbad2cd44072d6d20f34dd795327c14ece0a82869e", "1f73579ddf36e03fa52f93de177e8501a3c60ffe9a4ce316805ea534a758cd29", "00be2365079a7b339bc78bafc50a892083e9c57b4fde6355dfe95a7bfe237e4e", "1e1292203e1b0513cda382a52bad89a6b95157caf571dead05f987ec42a69139"), ("02268888f1c777116531775c87ae0536dacd37e37f7fc861305cc926c101dcf3", "276680842eaa6effa33bcfe9bdba2962061e4a04f817a0ac7b75aa7488ccea15", "27ab7634337b8a1f06d140b7017fa06c0f7696400b8c8434b90cf67d4455cb49", "25063f1983fca39d282a15a515f282d7ba021ad51a2777df9c0c4aec26b959d4"), ("1714ec83a9098d0f967a343eb382768c527a35c3fd6916438d691c732d8aeed0", "14459be363ae06c0c8b59ba78343ea4674f060d376e8e775e91756479a004972", "0bea9c16d033a5608985c8b596ccdb60c5bb3e750c1f773ac05e2f5c1c23361e", "112ff9f14ad19b6a9a1acae2f141fe4a6707e50af7d12dcdd227e988b8e11daa"), ("215534c514b0d826370001453cedc732cf993561c76dfb9a3dff62a98e4a5873", "0f024fde4842885beb75e959092272853c3c524e31cc2048f1fd19c37881ed96", "0a58fe29184d4b0b45329bcd858f11b068525894032140ce910c81bdf6e7a18e", "22b7efad3a97d1a5d1e669c3ca3c0773e7c289b71781dfa66c9f65da05186149"), ("06ba74307c9d3f397d9d6a599cdbe49fc048f95b74e853672a771d04f182eab2", "06e7f865245d82015c8992acb888c8d384770c2591d1ead29d81a853d5f7eb42", "0334f5aabb4ec2886fc661f815f84d355cb0c4dabbfaa3436338335480f2b066", "1aacaeb540f19cd512be141ac0dfa52dc018a086c2c16e325f7b456186feff67"), ("0c66a3e2a5c536b745887524047804546e5cea2f5b7b0e065f6818e255bbad07", "2a4ddb2bbb02cb6d9aa13c2ff7c288b68d2bf3eccb05a9914139b12be2c6b8c4", "0f9b5586925b939232ae087f92d6b0f8b15c7c85652fb75ea1e5db6f80a1c8bb", "113bd9ab2d189cb0e70783b7b68cdbfe19834a4c53b8976fd8b25b551a971c13"), ("149983b274713e9134fb34044be0239b7dfbe8a1523c5e6845d23c37b570eb2b", "2939a9ae2a84896e63213d822a33df434ca42f7ba86eed18c0cdee167383df22", "111923bdf94a296265d9df01cfab0ac8dac8e1bab9f9480fc2d4a017c82230c9", "0dfb81f48f64d67d322a73931586bdc56cef6800191e75325a0f8fed0c8f5481"), ("0c0675e87d522a3a81f66ddb81bbdbe9e39ac0527c9dcb7d900d16af1058def9", "1fc45c1e92c016f56ec2b987873a0eedce20d3fae1847e2dab0d74317a21de1f", "208267fe395ffc6f45d5b6e7b9c04a620d5d07c4828d8af93788a91c74a913d8", "24205a86d18d6fbe04cf31e74bd1fe
# StaticGroupMerkleRoot is the root of the Merkle tree constructed from the StaticGroupKeys above
# only identity commitments are used for the Merkle tree construction
# the root is created locally, using createMembershipList proc from waku_rln_relay_utils module, and the result is hardcoded in here
StaticGroupMerkleRoot* = "1e534adab58f7d300aaeecae57a25e0a0b18c368a09f720280da92b288950901"
const EpochUnitSeconds* = float64(10) # the rln-relay epoch length in seconds
const MaxClockGapSeconds* = 20.0 # the maximum clock difference between peers in seconds
# maximum allowed gap between the epochs of messages' RateLimitProofs
const MaxEpochGap* = uint64(MaxClockGapSeconds/EpochUnitSeconds)
# RLN Keystore defaults
const
RLNAppInfo* = AppInfo(application: "waku-rln-relay", appIdentifier: "01234567890abcdef", version: "0.2")