Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,15 +96,9 @@ jobs:
# The change happened on Nimble v0.14.0. Also forcing the deps to be reinstalled on each os and cpu.
key: nimbledeps-${{ matrix.nim.ref }}-${{ matrix.builder }}-${{ matrix.platform.cpu }}-${{ hashFiles('.pinned') }} # hashFiles returns a different value on windows

- name: Setup python
run: |
mkdir .venv
python -m venv .venv

- name: Install deps
if: ${{ steps.deps-cache.outputs.cache-hit != 'true' }}
run: |
source .venv/bin/activate
nimble install_pinned

- name: Use gcc 14
Expand All @@ -118,8 +112,6 @@ jobs:

- name: Run tests
run: |
source .venv/bin/activate

nim --version
nimble --version
gcc --version
Expand Down
2 changes: 1 addition & 1 deletion .pinned
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ dnsclient;https://github.com/ba0f3/dnsclient.nim@#23214235d4784d24aceed99bbfe153
faststreams;https://github.com/status-im/nim-faststreams@#720fc5e5c8e428d9d0af618e1e27c44b42350309
httputils;https://github.com/status-im/nim-http-utils@#3b491a40c60aad9e8d3407443f46f62511e63b18
json_serialization;https://github.com/status-im/nim-json-serialization@#85b7ea093cb85ee4f433a617b97571bd709d30df
mbedtls;https://github.com/status-im/nim-mbedtls.git@#740fb2f469511adc1772c5cb32395f4076b9e0c5
mbedtls;https://github.com/status-im/nim-mbedtls.git@#b9ee2b8cd8990d32afc227a4d64fb22441160704
metrics;https://github.com/status-im/nim-metrics@#6142e433fc8ea9b73379770a788017ac528d46ff
ngtcp2;https://github.com/status-im/nim-ngtcp2@#6834f4756b6af58356ac9c4fef3d71db3c3ae5fe
nimcrypto;https://github.com/cheatfate/nimcrypto@#1c8d6e3caf3abc572136ae9a1da81730c4eb4288
Expand Down
4 changes: 2 additions & 2 deletions examples/go-daemon/chat.nim
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ proc serveThread(udata: CustomData) {.async.} =
pending.add(item.write(msg))
if len(pending) > 0:
var results = await all(pending)
except:
echo getCurrentException().msg
except CatchableError as err:
echo err.msg

proc main() {.async.} =
var data = new CustomData
Expand Down
2 changes: 1 addition & 1 deletion libp2p.nimble
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
mode = ScriptMode.Verbose

packageName = "libp2p"
version = "1.8.0"
version = "1.9.0"
author = "Status Research & Development GmbH"
description = "LibP2P implementation"
license = "MIT"
Expand Down
14 changes: 6 additions & 8 deletions libp2p/multihash.nim
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,11 @@ import poseidon2
import varint, vbuffer, multicodec, multibase
import stew/base58
import stew/results
import blscurve/bls_public_exports

export results
# This is workaround for Nim `import` bug.
export sha, sha2, keccak, blake2, hash, utils
export sha, sha2, keccak, blake2, hash, utils, bls_public_exports

const
MaxHashSize* = 128
Expand Down Expand Up @@ -111,13 +113,9 @@ proc blake2Shash(data: openArray[byte], output: var openArray[byte]) =

proc sha2_256hash(data: openArray[byte], output: var openArray[byte]) =
if len(output) > 0:
var digest = sha256.digest(data)
var length =
if sha256.sizeDigest > len(output):
len(output)
else:
sha256.sizeDigest
copyMem(addr output[0], addr digest.data[0], length)
var digest: array[32, byte]
digest.bls_sha256_digest(data)
copyMem(addr output[0], addr digest[0], 32)

proc sha2_512hash(data: openArray[byte], output: var openArray[byte]) =
if len(output) > 0:
Expand Down
2 changes: 1 addition & 1 deletion libp2p/protocols/connectivity/autonat/client.nim
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ method dialMe*(
of ResponseStatus.Ok:
try:
response.ma.tryGet()
except:
except ResultError[void]:
raiseAssert("checked with if")
of ResponseStatus.DialError:
raise newException(
Expand Down
2 changes: 1 addition & 1 deletion tests/helpers.nim
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ template checkTrackers*() =
{.push warning[BareExcept]: off.}
try:
GC_fullCollect()
except:
except CatchableError:
discard
when defined(nimHasWarnBareExcept):
{.pop.}
Expand Down
4 changes: 1 addition & 3 deletions tests/hole-punching-interop/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ WORKDIR /workspace

COPY .pinned libp2p.nimble nim-libp2p/

RUN --mount=type=cache,target=/var/cache/apt apt-get update && apt-get install -y python python3 python3-pip python3-venv curl

RUN mkdir .venv && python3 -m venv .venv && . .venv/bin/activate
RUN --mount=type=cache,target=/var/cache/apt apt-get update

RUN cd nim-libp2p && nimble install_pinned && nimble install redis -y

Expand Down
2 changes: 1 addition & 1 deletion tests/pubsub/testgossipsub.nim
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ suite "GossipSub":
checkUntilTimeout(
try:
gossip2.validationSeen[msgId].len > 0
except:
except KeyError:
false
)
result = ValidationResult.Accept
Expand Down
4 changes: 1 addition & 3 deletions tests/transport-interop/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ WORKDIR /app

COPY .pinned libp2p.nimble nim-libp2p/

RUN --mount=type=cache,target=/var/cache/apt apt-get update && apt-get install -y python python3 python3-pip python3-venv curl

RUN mkdir .venv && python3 -m venv .venv && . .venv/bin/activate
RUN --mount=type=cache,target=/var/cache/apt apt-get update

RUN cd nim-libp2p && nimble install_pinned && nimble install "redis@#b341fe240dbf11c544011dd0e033d3c3acca56af" -y

Expand Down
Loading