* bumps bearssl
* updates version of bearssl in lockfiles
* fixes that checksum
* attempt to bump various dependencies
* updates asynctest version tag
* asynctest sha
* bumps to working version of nim-datastore
* adjusts asynctest imports for chronos
* chronos checksum
* checksum for datastore
* libp2p version tag
* libp2p checksum
* moves libp2p from codex-branch to latest master
* libp2p checksum
* splits the test dependencies from the dev dependencies (example nim-ethers)
* sets path
* pathing in tests
* oops wrong version
* adds build.nims to installfiles for test module
* attempt to fix import paths
* bumps nim-datastore
* datastore checksum
* greatly simplify CI
* fixes asynctest import
* builds parallel tests before running
* bumps datastore
* turns nim-stable back off
* pins nim-datastore version
* bumps checkout to v4
* Review comment by Mark
Co-authored-by: markspanbroek <mark@spanbroek.net>
* Review comment by Mark
Co-authored-by: markspanbroek <mark@spanbroek.net>
---------
Co-authored-by: markspanbroek <mark@spanbroek.net>
* 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
* 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>
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
* make encryption scheme explicit
* supress compiler noise
* make `nimble install` without `-d` work
* move `libp2p_pki_schemes=secp256k1` to config.nims
* fix include
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
* track nim-libp2p's unstable branch and nim-bearssl's master branch
refactor accordingly: mainly switching from `import bearssl` to
`import bearssl/rand`, `BrHmacDrbgContext` to `HmacDrbgContext`, and related
changes
* fix ambiguous identifier
* nim 1.4 is deprecated
Co-authored-by: Michael Bradley, Jr <michaelsbradleyjr@gmail.com>
* initial providers manager implementation
* misc license update
* spelling
* rename provider tests
* add provider tests
* reexport provider manager
* only update provider record if it changed
* small bug in getProvByKey
* pass providers to both constructors
* fix records retrieval
* disable cache during tests
* avoid redefining data
* adding back tests with cache
* use `.errorOption`
* proper err msg unpacking
Closes: #2.
Libp2p supports multiple cryptographic curves, however we have currently only implented support for secp256k1.
This needs to be run with the compiler flag `libp2p_pki_schemes` set to `secp256k1`. If running the tests, this can be run like so: `nimble test —libp2p_pki_schemes=secp256k1` to put secp as the first supported crypto scheme.
Swap all instances of Record with SignedPeerRecord.
Allow for `SignedPeerRecord`s to be updated by updating the first multiaddress in the `PeerRecord`. This also increments the `seqNo` in the `PeerRecord` only if the address was actually updated.
Merge the add/get providers messages with the discovery v5 messages inside of the discovery v5 code. Discovery v5 uses RLP encoding, while the add/get providers uses protobufs, as per the libp2p spec. The merge of these two uses RLP on the outer wrapper of the message, and a protobuf-encoded blob on the “inside” for the add/get providers messages only. Eventually this needs to change so that we use protobufs only.
There is still some code in the libp2pdht/dht directory, which is being read from the discovery v5 directory. Eventually these two should merge as well.
Add CI workflow to run tests.
Add code coverage workflow that publishes results to CodeCov.
Add CI and coverage badges to README.
Bump asynctest to allow for `setupAll` and `teardownAll`.
Add local coverage nimble task.
Combine tests in to a testAll file.
Project has been updated to use nimble as a build system. All required dependencies have been added.
All nim-eth mirrored files were added to a private folder in the libp2pdht module. A libp2pdht/discv5 module was added to alias the nim-eth modules (which will change over time).
Test have been updated to use status-im/asynctest. This PR uses a branch of asynctest that supports async suite before/after. This seemed like the only the tests would work without throwing gcsafe errors.
All tests working.
Protocol was actually made of two sub-protocols.
* a lower-half handling authentication, encryption,
key exchange, and request/response. This is now called
Transport.
* an upper-half handling DHT messages. This is still
called Protocol.
Separation of these two reduces dependencies and simplifies
modifications to the protocol.
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>