63 Commits
Author SHA1 Message Date
Arnaud 01fe85b53a chore: update libp2p version (#116) 2026-08-03 11:28:27 -03:00
Arnaud d02670d6b0 feat: client mode (#115)
* Add client mode in findNode

* Remove clientMode checking in addProvider

* Add clientMode check over TalkProtocol

* Fix client mode checking

* Add register talk protocol unicity check

* Add future callback to prevent unbound growth

* Fix PR reviews

* Use DhtMode

* Add clientMode in the Message

* Fix minor issues

* Add logs

* Switch to Nim 2.2.10 on CI

* Add client mode even when the value is false

* Move the client mode check at the beginning of the proc

* Increment version

* Replace uint64 by uint32
2026-05-14 10:04:27 +04:00
Arnaud 3a6a3e771a Fix crash (#113) 2026-04-24 18:33:31 +04:00
ArnaudandEric 64091a17ee chore: update nim 2.2.8 (#111)
* Update to 2.2.8

* Reduce chronicles requirement version

* Restore Nim 2.2.4 in nimble

* Update ci

* Update ci version

* Try to remove windows

* Restore previous action

* Try to upgrade nimble version

* Try to fix dependencies issue

* Try to downgrade nimble

* Try 0.20.0

* Add nimble lock

* Remove nimble custom install

* Trying something

* Fix syntax

* debug

* Restore dependencies version and update chronos upper bound version

* Remove debug statements

* Remove debug statements

* Remove debug statements

* Update codexdht/private/eth/p2p/discoveryv5/providers/maintenance.nim

Co-authored-by: Eric <5089238+emizzle@users.noreply.github.com>

* Update codexdht/private/eth/p2p/discoveryv5/providers/maintenance.nim

Co-authored-by: Eric <5089238+emizzle@users.noreply.github.com>

* Refactor to use questionable

* Revert unneeded changes

* Remove spaces

---------

Co-authored-by: Eric <5089238+emizzle@users.noreply.github.com>
2026-04-21 15:25:19 +04:00
Chrysostomos Nanakos 754765ba31 chore: orc support (#110)
Support ORC memory model (https://github.com/logos-storage/logos-storage-nim-dht/issues/109)

Signed-off-by: Chrysostomos Nanakos <chris@include.gr>
2025-12-23 23:23:31 +02:00
Arnaud 99884b5971 Rename Codex to Logos Storage (#108) 2025-12-15 13:46:04 +01:00
Jacek Sieka 6c7de03622 chore: bump stew et al (#107)
* fix use of deprecated imports
* bump stew
* `results` is its own package
* drop protobuf_serialization
* force leveldb version
2025-12-11 13:47:10 +01:00
Eric 14d4dd97e9 toBytes -> toBytesBE 2025-02-13 12:15:00 +11:00
Eric bc27eebb85 fix pinned deps
Leaving nim-datastore as a commit hash until it has a relevant release tag
2025-02-13 12:08:09 +11:00
Arnaud 5f22be0420 Remove useless comment 2024-12-18 10:52:06 +01:00
Arnaud 4eb4e9126a Use IpAddress instead of ValidAddress; remove unused import 2024-12-18 10:50:02 +01:00
Arnaud d73dc48515 Add pragma for exception raises 2024-12-09 12:47:08 +01:00
Csaba Kiraly 57f4b6f7cb Merge pull request #103 from codex-storage/fix-randomNodes
fix potential infinite loop in randomNodes
2024-10-18 20:45:49 +02:00
Csaba Kiraly a6cfe1a084 fix potential infinite loop in randomNodes
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
2024-10-17 12:38:54 +02:00
Csaba Kiraly 1a344f1fd7 log reliability based on loss statistics
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
2024-10-15 18:17:49 +02:00
Csaba Kiraly fee5a9ced2 set NoreplyRemoveThreshold to 0.5
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
2024-10-14 15:35:15 +02:00
Csaba Kiraly 6310c50ce0 introduce NoreplyRemoveThreshold
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>

# Conflicts:
#	codexdht/private/eth/p2p/discoveryv5/protocol.nim
2024-10-14 15:35:10 +02:00
Csaba Kiraly 7507e99c96 register "not seen" when missing replies
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
2024-10-14 15:33:34 +02:00
Csaba Kiraly 02bc12e639 change node seen flag to an exponential moving average
keep defaults as before

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>

# Conflicts:
#	codexdht/private/eth/p2p/discoveryv5/node.nim
#	codexdht/private/eth/p2p/discoveryv5/routing_table.nim
2024-10-14 15:33:29 +02:00
Csaba Kiraly e1c1089e4f fix aggressive node removal from on first packet loss
UDP packets get lost easily. We can't just remove
nodes from the routing table at first loss, as it can
create issues in small networks and in cases of temporary
connection failures.

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
2024-10-14 15:28:09 +02:00
Csaba Kiraly c1d2ea410d Merge pull request #102 from codex-storage/measure-rtt-bw
Measure rtt, estimate bw, and log every 5 minutes
2024-10-14 14:19:35 +02:00
Csaba Kiraly 8b1660464d don't log bandwidth estimates
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
2024-10-14 13:57:52 +02:00
Csaba Kiraly 7057663f81 fixup: remove excessive debug
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
2024-10-14 11:19:36 +02:00
Csaba Kiraly 4ccaaee721 rename metrics to dht_ from discovery_
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>

# Conflicts:
#	codexdht/private/eth/p2p/discoveryv5/transport.nim
2024-10-10 11:44:26 +02:00
Csaba Kiraly 80cc069c5e metrics: add transport byte counters
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>

# Conflicts:
#	codexdht/private/eth/p2p/discoveryv5/transport.nim
2024-10-10 11:43:23 +02:00
Csaba Kiraly ffeeeeb3fb transport: add metrics
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>

# Conflicts:
#	codexdht/private/eth/p2p/discoveryv5/transport.nim
2024-10-10 11:42:11 +02:00
Csaba Kiraly 4d2250477e metrics: add discovery_routing_table_buckets
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
2024-10-10 11:40:45 +02:00
Csaba Kiraly b7b04ed9e4 metrics: rename routing_table_nodes to discovery_routing_table_nodes
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
2024-10-10 11:40:44 +02:00
Csaba Kiraly 706cb50041 add debugPrintLoop to print neighborhood info
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
2024-10-08 11:31:06 +02:00
Csaba Kiraly 0825d887ea add bandwidth estimate
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
2024-10-08 11:31:06 +02:00
Csaba Kiraly ec4f0d4a84 add transport level RTT measurement
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
2024-10-08 11:18:02 +02:00
Csaba Kiraly 0b69de242f add rtt measurement
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
2024-10-08 11:17:58 +02:00
Csaba Kiraly f3eec2a202 node: add RTT and bandwidth measurement holders
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
2024-10-08 11:17:29 +02:00
Csaba Kiraly f6971cc947 logging: better logging of SPR update
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
2024-10-08 11:15:50 +02:00
Csaba Kiraly 4d9e39d86c transport: improve logging
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>

# Conflicts:
#	codexdht/private/eth/p2p/discoveryv5/transport.nim
2024-10-08 11:15:20 +02:00
Csaba Kiraly b8bcb2d08d Merge pull request #95 from codex-storage/factorize
Factorize code
2024-10-07 14:06:59 +02:00
Csaba Kiraly f121d080e7 Merge pull request #96 from codex-storage/reduce-timeouts
Reduce timeouts
2024-10-03 10:54:44 +02:00
Csaba Kiraly fef297c622 Merge pull request #94 from codex-storage/feature-FindNodeFastResultLimit
Add separate limit for results returned in FindNodeFast
2024-10-01 15:04:26 +02:00
Csaba Kiraly 936a5ec6fa Merge pull request #93 from codex-storage/fix-FindNodeResultLimit
fix returning too many nodes when FindNodeResultLimit!=BUCKET_SIZE
2024-10-01 14:51:33 +02:00
Ben Bierens 9acdca795b routing table logging update (#97)
* Clear logs for adding and removing of nodes. routingtable log topic for filtering.

* Makes node ID shortening consistent with other short-id formats

* redundant else block

* fixes dependencies
2024-09-23 15:49:08 +02:00
Csaba Kiraly 5624700855 reduce default timeouts
We really don't need these to be 2 and 4 seconds.
Later we should tune it better based on measurements
or estimates. We should also check the relation between
these three values.

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
2024-07-01 04:34:10 +02:00
Csaba Kiraly 76da855725 use handshakeTimeout if handshake starting in sendMessage
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
2024-07-01 04:20:20 +02:00
Csaba Kiraly 4c9c92232b remove unused sendRequest call
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
2024-07-01 04:14:17 +02:00
Csaba Kiraly 148b10908d trace log: do not log binary encoding
Even at trace level this feels too much.

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
2024-07-01 04:14:13 +02:00
Csaba Kiraly f299c23e2e remove lookupWorkerFast duplicate code
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
2024-07-01 04:14:03 +02:00
Csaba Kiraly bdf57381e3 introduce FindNodeFastResultLimit
We do not need that many responses with FindNodeFast, since the
reposes can be ordered by distance

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
2024-07-01 04:06:43 +02:00
Csaba Kiraly 4b82bdc2f9 fix returning too many nodes when FindNodeResultLimit!=BUCKET_SIZE
Code assumed these two values to be the same, resulting in
reception errors.

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
2024-07-01 03:55:03 +02:00
Csaba Kiraly d8160ff0f7 add logging helper for Protocol
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
2024-06-28 17:39:13 +02:00
Csaba Kiraly f766cb39b1 encoding: introducing type cipher=aes128
Introducing the cipher type to ease changing cipher.
No functional change

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
2024-06-28 17:37:26 +02:00
Csaba Kiraly 316464fc71 dht: waitMessage: expose timeout as parameter, keeping default
defults to ResponseTimeout as before

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
2024-06-28 17:35:29 +02:00