From e2970b49abd985beb85429d2b548412e7a3c2d42 Mon Sep 17 00:00:00 2001 From: Diego Date: Wed, 26 Jun 2024 21:04:13 +0200 Subject: [PATCH 01/11] upgrade nimcrypto --- quic.nimble | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quic.nimble b/quic.nimble index 002181a..c9b05e3 100644 --- a/quic.nimble +++ b/quic.nimble @@ -7,7 +7,7 @@ license = "MIT" requires "nim >= 1.2.6" requires "stew >= 0.1.0 & < 0.2.0" requires "chronos >= 3.0.0 & < 4.0.0" -requires "nimcrypto >= 0.5.4 & < 0.6.0" +requires "nimcrypto >= 0.6.0 & < 0.7.0" requires "ngtcp2 >= 0.32.0 & < 0.34.0" requires "upraises >= 0.1.0 & < 0.2.0" requires "unittest2 >= 0.0.4 & < 0.1.0" From 121aa1955449b09aee6e0143382191bed5b66f62 Mon Sep 17 00:00:00 2001 From: Diego Date: Wed, 26 Jun 2024 21:13:53 +0200 Subject: [PATCH 02/11] upgrade unittest2 --- quic.nimble | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quic.nimble b/quic.nimble index c9b05e3..01618b4 100644 --- a/quic.nimble +++ b/quic.nimble @@ -10,4 +10,4 @@ requires "chronos >= 3.0.0 & < 4.0.0" requires "nimcrypto >= 0.6.0 & < 0.7.0" requires "ngtcp2 >= 0.32.0 & < 0.34.0" requires "upraises >= 0.1.0 & < 0.2.0" -requires "unittest2 >= 0.0.4 & < 0.1.0" +requires "unittest2 >= 0.1.0 & < 0.2.0" From 546b217f009956f1c639cbfcb1ef28167713fc5a Mon Sep 17 00:00:00 2001 From: Diego Date: Wed, 26 Jun 2024 21:16:11 +0200 Subject: [PATCH 03/11] upgrade nim --- .github/workflows/test.yml | 2 +- quic.nimble | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f878cc5..cc50688 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,7 +14,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, macOS-latest, windows-latest] - nim: [1.2.18, stable] + nim: [1.6.20, stable] steps: - uses: actions/checkout@v2 - uses: iffy/install-nim@v3 diff --git a/quic.nimble b/quic.nimble index 01618b4..dc02145 100644 --- a/quic.nimble +++ b/quic.nimble @@ -4,7 +4,7 @@ author = "Status Research & Development GmbH" description = "QUIC protocol implementation" license = "MIT" -requires "nim >= 1.2.6" +requires "nim >= 1.6.0" requires "stew >= 0.1.0 & < 0.2.0" requires "chronos >= 3.0.0 & < 4.0.0" requires "nimcrypto >= 0.6.0 & < 0.7.0" From 867e2810ceb204c901abd9b4637852a8b28d8a13 Mon Sep 17 00:00:00 2001 From: Diego Date: Wed, 26 Jun 2024 21:33:37 +0200 Subject: [PATCH 04/11] upgrade unittest2 --- quic.nimble | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quic.nimble b/quic.nimble index dc02145..6c1e48d 100644 --- a/quic.nimble +++ b/quic.nimble @@ -10,4 +10,4 @@ requires "chronos >= 3.0.0 & < 4.0.0" requires "nimcrypto >= 0.6.0 & < 0.7.0" requires "ngtcp2 >= 0.32.0 & < 0.34.0" requires "upraises >= 0.1.0 & < 0.2.0" -requires "unittest2 >= 0.1.0 & < 0.2.0" +requires "unittest2 >= 0.2.2 & < 0.3.0" From d003c9a48c21b70a74f9f1a81e4ef0600cd1e96b Mon Sep 17 00:00:00 2001 From: Diego Date: Thu, 27 Jun 2024 16:36:23 +0200 Subject: [PATCH 05/11] fix compilation error --- quic/transport/ngtcp2/stream/openstate.nim | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/quic/transport/ngtcp2/stream/openstate.nim b/quic/transport/ngtcp2/stream/openstate.nim index a5f2547..20025e7 100644 --- a/quic/transport/ngtcp2/stream/openstate.nim +++ b/quic/transport/ngtcp2/stream/openstate.nim @@ -49,9 +49,9 @@ method read(state: OpenStream): Future[seq[byte]] {.async.} = state.allowMoreIncomingBytes(result.len.uint64) method write(state: OpenStream, bytes: seq[byte]): Future[void] = - let stream = state.stream.valueOr: - raise newException(QuicError, "stream is closed") - state.connection.send(stream.id, bytes) + # let stream = state.stream.valueOr: + # raise newException(QuicError, "stream is closed") + state.connection.send(state.stream.get.id, bytes) method close(state: OpenStream) {.async.} = let stream = state.stream.valueOr: return From 740e60da6dfe6683cf1dfd45da4c5c16e7212884 Mon Sep 17 00:00:00 2001 From: Diego Date: Fri, 28 Jun 2024 17:18:31 +0200 Subject: [PATCH 06/11] remove nim 2 from test workflow --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index cc50688..815b6a8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,7 +14,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, macOS-latest, windows-latest] - nim: [1.6.20, stable] + nim: [1.6.20] steps: - uses: actions/checkout@v2 - uses: iffy/install-nim@v3 From 1631b32c55cb6c128994d1ca4f3f68232dd3196c Mon Sep 17 00:00:00 2001 From: Diego Date: Mon, 1 Jul 2024 22:35:39 +0200 Subject: [PATCH 07/11] fix compilation error --- quic/transport/packets/write.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quic/transport/packets/write.nim b/quic/transport/packets/write.nim index b7e0f0f..f82d281 100644 --- a/quic/transport/packets/write.nim +++ b/quic/transport/packets/write.nim @@ -102,7 +102,7 @@ proc writePacketNumber(writer: var PacketWriter, datagram: var openArray[byte], proc writePacketNumberAndPayload*(writer: var PacketWriter, datagram: var openArray[byte]) = - let packetnumber = writer.packet.packetnumber.toMinimalBytes + let packetnumber = writer.packet.packetNumber.toMinimalBytes let payload = writer.packet.payload writer.writePacketLength(datagram, packetnumber.len + payload.len) writer.writePacketNumber(datagram, packetnumber) From ca9a029b63a2c00e3b936928846af9233abd13d6 Mon Sep 17 00:00:00 2001 From: Diego Date: Mon, 1 Jul 2024 23:03:24 +0200 Subject: [PATCH 08/11] fix deadlock --- quic/connection.nim | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/quic/connection.nim b/quic/connection.nim index e0e6798..021acb8 100644 --- a/quic/connection.nim +++ b/quic/connection.nim @@ -44,7 +44,8 @@ proc startSending(connection: Connection, remote: TransportAddress) = try: let datagram = await connection.quic.outgoing.get() await connection.udp.sendTo(remote, datagram.data) - except TransportError: + except TransportError as e: + connection.loop.fail(e) # This might need to be revisited await connection.drop() connection.loop = asyncLoop(send) From 0550ccf5160d18226c61c25dade1b3f1ce517cf8 Mon Sep 17 00:00:00 2001 From: Diego Date: Mon, 1 Jul 2024 23:07:06 +0200 Subject: [PATCH 09/11] upgrade chronos --- quic.nimble | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quic.nimble b/quic.nimble index 6c1e48d..019a0de 100644 --- a/quic.nimble +++ b/quic.nimble @@ -6,7 +6,7 @@ license = "MIT" requires "nim >= 1.6.0" requires "stew >= 0.1.0 & < 0.2.0" -requires "chronos >= 3.0.0 & < 4.0.0" +requires "chronos >= 4.0.0 & < 5.0.0" requires "nimcrypto >= 0.6.0 & < 0.7.0" requires "ngtcp2 >= 0.32.0 & < 0.34.0" requires "upraises >= 0.1.0 & < 0.2.0" From 5e5dd5498205f0097f193886ccf5e1d4d4bd6715 Mon Sep 17 00:00:00 2001 From: Diego Date: Tue, 2 Jul 2024 01:57:52 +0200 Subject: [PATCH 10/11] Revert "upgrade chronos" This reverts commit 0550ccf5160d18226c61c25dade1b3f1ce517cf8. --- quic.nimble | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quic.nimble b/quic.nimble index 019a0de..6c1e48d 100644 --- a/quic.nimble +++ b/quic.nimble @@ -6,7 +6,7 @@ license = "MIT" requires "nim >= 1.6.0" requires "stew >= 0.1.0 & < 0.2.0" -requires "chronos >= 4.0.0 & < 5.0.0" +requires "chronos >= 3.0.0 & < 4.0.0" requires "nimcrypto >= 0.6.0 & < 0.7.0" requires "ngtcp2 >= 0.32.0 & < 0.34.0" requires "upraises >= 0.1.0 & < 0.2.0" From 3c0f0216cdf2e7a06b1b2fcddfa6c6164bddbd6d Mon Sep 17 00:00:00 2001 From: Diego Date: Thu, 4 Jul 2024 18:10:54 +0200 Subject: [PATCH 11/11] add link to PR --- quic/connection.nim | 2 +- quic/transport/ngtcp2/stream/openstate.nim | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/quic/connection.nim b/quic/connection.nim index 021acb8..1338e3d 100644 --- a/quic/connection.nim +++ b/quic/connection.nim @@ -45,7 +45,7 @@ proc startSending(connection: Connection, remote: TransportAddress) = let datagram = await connection.quic.outgoing.get() await connection.udp.sendTo(remote, datagram.data) except TransportError as e: - connection.loop.fail(e) # This might need to be revisited + connection.loop.fail(e) # This might need to be revisited, see https://github.com/status-im/nim-quic/pull/41 for more details await connection.drop() connection.loop = asyncLoop(send) diff --git a/quic/transport/ngtcp2/stream/openstate.nim b/quic/transport/ngtcp2/stream/openstate.nim index 20025e7..cda3d11 100644 --- a/quic/transport/ngtcp2/stream/openstate.nim +++ b/quic/transport/ngtcp2/stream/openstate.nim @@ -51,6 +51,7 @@ method read(state: OpenStream): Future[seq[byte]] {.async.} = method write(state: OpenStream, bytes: seq[byte]): Future[void] = # let stream = state.stream.valueOr: # raise newException(QuicError, "stream is closed") + # See https://github.com/status-im/nim-quic/pull/41 for more details state.connection.send(state.stream.get.id, bytes) method close(state: OpenStream) {.async.} =