197 Commits

Author SHA1 Message Date
Dmitriy Ryajov
beefafcc6f
Update CleanupInterval to 24 hours (#88) 2023-11-21 17:14:15 -08:00
Dmitriy Ryajov
a7f14bc9b7
Fix logging format (#87)
* add shortLog for Address

* compile with trace logging to catch errors
2023-11-20 09:34:40 -08:00
Dmitriy Ryajov
dd4985435a
Fix timeout and delete (#86)
* use unix time for ttl

* don't remove all entries on peer removal

* cleanup questionable tuple destructure

* ignore vscode

* fix endians decoding

* allow removing by peerId

* invalidate cache by peerId on remove

* update test
2023-11-17 14:01:16 -08:00
Csaba Kiraly
91b2eaec89
Fix: arrive to working keys in case of simultaneous cross connect (#84)
* improve tracing of message exchange

run e.g. as
```
nim c -r -d:debug -d:chronicles_enabled=on -d:chronicles_log_level=TRACE -d:chronicles_sinks=textlines[nocolors,stdout] tests/dht/test_providers.nim >err
```

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

* add debug on Handshake timeour

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

* queue messages during handshake and send later

If a handshake was already in progress, messages were dropped.
Instead of this, it is better to queue these and send as soon
as the handshake is finished and thus the encryption key is known.

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

* rename handshakeInProgress to keyexchangeInProgress

Handshake is also a name of a message, which makes previous
name less clear.

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

* keyexchangeInProgress: do not remove on handshake received

This is the wrong direction, not needed

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

* fix cross-connect key exchange

Since key exchange can be started both ways simultaneously, and
these might not get finalised with UDP transport, we can't be
sure what encryption key will be used by the other side:
- the one derived in the key-exchange started by us,
- the one derived in the key-exchange started by the other node.
To alleviate this issue, we store two decryption keys in each session.

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

---------

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
2023-11-17 11:50:28 -08:00
Csaba Kiraly
66116b9bf6
Fix: queue messages when there is no encryption key (#83)
* encodeMessagePacket: expose haskey

encodeMessagePacket checks for session and behaves differently
based on that. Exposing this difference in behavior.

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

* improve tracing of message exchange

run e.g. as
```
nim c -r -d:debug -d:chronicles_enabled=on -d:chronicles_log_level=TRACE -d:chronicles_sinks=textlines[nocolors,stdout] tests/dht/test_providers.nim >err
```

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

* add debug on Handshake timeour

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

* queue messages during handshake and send later

If a handshake was already in progress, messages were dropped.
Instead of this, it is better to queue these and send as soon
as the handshake is finished and thus the encryption key is known.

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

* rename handshakeInProgress to keyexchangeInProgress

Handshake is also a name of a message, which makes previous
name less clear.

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

* keyexchangeInProgress: do not remove on handshake received

This is the wrong direction, not needed

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

---------

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
2023-11-17 11:18:48 -08:00
Jaremy Creechley
60dc4e764c
Fix changes from stint (#81)
* some formatting tweaks to make errors easier to grok

* stint removed overloads for regular ints - use stew versions instead

* various name style fixes

* ignore vscode stuff

* revert style changes

* revert unneeded var rename changes

---------

Co-authored-by: Dmitriy Ryajov <dryajov@gmail.com>
2023-11-17 11:08:45 -08:00
Dmitriy Ryajov
ee5d8acb05
cleanup and avoid lockups (#85) 2023-09-20 09:20:26 -07:00
Slava
ed7caa119d
Update CI workflow trigger branch (#82)
* Update CI workflow trigger branch

* Update Codecov workflow trigger branch and badges
2023-08-26 09:31:31 +03:00
Jaremy Creechley
fdd02450aa
bump release (#79) 2023-07-25 19:56:25 -07:00
Jaremy Creechley
b585290397
Bump deps (#77)
Updates all Status IM and Codex Storage deps to the latest except for nim-stint which is held back due to some compiler issue. 

* fix nimble name
* don't override nimble
* update all deps
* import nimble.lock and fix urls
* don't forget nim
* bump to chronos with async notifications
2023-07-21 15:29:38 -07:00
Dmitriy Ryajov
9ae0bfb1c3
Fix nimble install (#78)
* make encryption scheme explicit

* supress compiler noise

* make `nimble install` without `-d` work

* move `libp2p_pki_schemes=secp256k1` to config.nims

* fix include
2023-07-21 15:51:42 -06:00
Jaremy Creechley
1f27eb4aff
Upgrade secp256k1 deps (#76)
* import full secret hash from upstream
* use full secret hash including prefix byte 0x02 / 0x03
* import nimble lock
* fix atlas lock
* update stint
* cleanup urls
* bump lock files
* match lockfiles
2023-07-19 17:04:28 -07:00
Jaremy Creechley
fc7d7ef80c
version bump - stable ci version v0.3.2 2023-07-17 15:34:59 -07:00
Ivan Yonchovski
ae844ec4c5
Restore coverage (#74)
* Restore coverage
* use nimble setup for now
* Update codecov.yml
* fix lcov
* re-add nim binary to lockfile

---------

Co-authored-by: Jaremy Creechley <creechley@gmail.com>
2023-07-17 15:32:55 -07:00
Jaremy Creechley
d4331f8062
Remove nimbus build (#73)
* Remove Nimbus
* adds docs for Nimble 0.14
* cleanup
2023-07-17 12:43:14 -07:00
Jaremy Creechley
7464c8e9a6
Split windows tests (#70)
Changes the CI to properly cache Nimble deps *including* Nim binaries. 

* parallelize tests
* speed up tests
* cache whole nimble
* use nimble install without -d
* bump version
* new nimble cache
* fix github_env
* compare speed
* readd msys2
* don't need make for nimble
* ugh renames
v0.3.1
2023-07-13 20:42:43 -07:00
Jaremy Creechley
18dbe4cc04
Merge pull request #69 from codex-storage/rename-library
Finish renaming library
2023-07-12 16:13:13 -07:00
Jaremy Creechley
127d7be4e5
bump version v0.3.0 2023-07-12 15:47:16 -07:00
Jaremy Creechley
d7cc0ae783
renaming imports 2023-07-12 14:58:29 -07:00
Jaremy Creechley
c3d073c3da
finishing renaming 2023-07-12 14:57:26 -07:00
Jaremy Creechley
96515d6d45
Merge pull request #67 from codex-storage/nimble-build-light
* import nimbus build tools
* add nimbus build
* updates
* add nat traversal to make nimbus happy
* clone nimbus vendor using atlas
* disable ci-nimbus
* only run ci-nimbus on lockfile change
* add nim setup
* caching - change names
* restore names
* cleanup & test
* bump version
2023-07-12 14:53:52 -07:00
Jaremy Creechley
c516a02a65
bump version v0.2.1 2023-07-12 14:47:07 -07:00
Jaremy Creechley
2e47eaa686
merge 2023-07-12 14:43:46 -07:00
Jaremy Creechley
7a5639d570
bump version 2023-07-12 14:33:31 -07:00
Jaremy Creechley
5dae32b0a7
ignores 2023-07-11 18:48:22 -07:00
Jaremy Creechley
39f1364982
cleanup & test 2023-07-11 18:42:41 -07:00
Jaremy Creechley
0f7732cb66
try cache again 2023-07-11 17:58:06 -07:00
Jaremy Creechley
ff18bf6fc3
restore names 2023-07-11 17:53:01 -07:00
Jaremy Creechley
31413856f6
Revert "caching"
This reverts commit ef68f139387e30de0004fd6a1262e9ea531f33d7.
2023-07-11 17:50:44 -07:00
Jaremy Creechley
f9c98e7de7
caching - change names 2023-07-11 17:44:54 -07:00
Jaremy Creechley
ef68f13938
caching 2023-07-11 17:40:26 -07:00
Jaremy Creechley
ff5853780c
caching 2023-07-11 17:39:48 -07:00
Jaremy Creechley
a3d050fc18
caching 2023-07-11 17:37:34 -07:00
Jaremy Creechley
4a241ffa8c
don't use update (?) target 2023-07-11 17:24:57 -07:00
Jaremy Creechley
3fd3008a82
updates 2023-07-11 17:22:17 -07:00
Jaremy Creechley
59d45be045
add nim setup 2023-07-11 17:15:42 -07:00
Jaremy Creechley
6fadf32ee8
tweaks 2023-07-11 17:08:27 -07:00
Jaremy Creechley
992cf83e3d
fake change to test ci-nimbus 2023-07-11 16:41:29 -07:00
Jaremy Creechley
8fdf907811
fake change to test ci 2023-07-11 16:29:27 -07:00
Jaremy Creechley
32cbb41a92
only run ci-nimbus on lockfile change 2023-07-11 16:28:04 -07:00
Jaremy Creechley
6cda13db5d
disable ci-nimbus 2023-07-11 16:21:48 -07:00
Jaremy Creechley
3f552af2ce
disable ci-nimbus 2023-07-11 16:16:54 -07:00
Jaremy Creechley
5e5851c1e2
clone nimbus vendor using atlas 2023-07-11 16:07:00 -07:00
Jaremy Creechley
58f91c48c0
add nat traversal to make nimbus happy 2023-07-11 15:59:27 -07:00
Jaremy Creechley
169e1d76e5
updates 2023-07-11 15:48:47 -07:00
Jaremy Creechley
bd72bc1e60
add nimbus build 2023-07-11 15:24:54 -07:00
Jaremy Creechley
b6a227f189
import nimbus build tools v0.2.0 2023-07-11 15:19:45 -07:00
Jaremy Creechley
95aa358ef3
Merge pull request #66 from codex-storage/add-nimble-locks
Add nimble locks
2023-07-11 14:57:55 -07:00
Ivan Yonchovski
873a04acb7 WIP 2023-07-11 16:03:21 +03:00
Ivan Yonchovski
85fc42cf5e WIP 2023-07-11 15:46:41 +03:00