-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add rolling bloom filter, reliability utils and protobuf (#4)
- Loading branch information
Showing
10 changed files
with
566 additions
and
147 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
nimcache | ||
nimcache/* | ||
tests/bloom | ||
tests/test_bloom | ||
nim-bloom/bloom | ||
.DS_Store | ||
src/.DS_Store | ||
src/.DS_Store | ||
nph |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Package | ||
version = "0.1.0" | ||
author = "Waku Team" | ||
description = "E2E Reliability Protocol API" | ||
license = "MIT" | ||
srcDir = "src" | ||
|
||
# Dependencies | ||
requires "nim >= 2.0.8" | ||
requires "chronicles" | ||
requires "libp2p" | ||
|
||
# Tasks | ||
task test, "Run the test suite": | ||
exec "nim c -r tests/test_bloom.nim" | ||
exec "nim c -r tests/test_reliability.nim" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import std/times | ||
|
||
type | ||
SdsMessageID* = seq[byte] | ||
SdsChannelID* = seq[byte] | ||
|
||
SdsMessage* = object | ||
messageId*: SdsMessageID | ||
lamportTimestamp*: int64 | ||
causalHistory*: seq[SdsMessageID] | ||
channelId*: SdsChannelID | ||
content*: seq[byte] | ||
bloomFilter*: seq[byte] | ||
|
||
UnacknowledgedMessage* = object | ||
message*: SdsMessage | ||
sendTime*: Time | ||
resendAttempts*: int | ||
|
||
const | ||
DefaultMaxMessageHistory* = 1000 | ||
DefaultMaxCausalHistory* = 10 | ||
DefaultResendInterval* = initDuration(seconds = 60) | ||
DefaultMaxResendAttempts* = 5 | ||
DefaultSyncMessageInterval* = initDuration(seconds = 30) | ||
DefaultBufferSweepInterval* = initDuration(seconds = 60) | ||
MaxMessageSize* = 1024 * 1024 # 1 MB |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.