From a1eda12475b6c7f02b7b98823c9d22c1023cc00b Mon Sep 17 00:00:00 2001 From: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com> Date: Sun, 15 Jan 2023 18:14:20 +0000 Subject: [PATCH 1/3] increase sending retries on ERR QUOTA --- src/Simplex/Messaging/Agent/Env/SQLite.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Simplex/Messaging/Agent/Env/SQLite.hs b/src/Simplex/Messaging/Agent/Env/SQLite.hs index 60afe9bcf..ca41e0b3e 100644 --- a/src/Simplex/Messaging/Agent/Env/SQLite.hs +++ b/src/Simplex/Messaging/Agent/Env/SQLite.hs @@ -122,9 +122,9 @@ defaultMessageRetryInterval = -- to resume sending on QCONT messages. -- After that local message expiration period should be also increased. RetryInterval - { initialInterval = 10_000000, + { initialInterval = 30_000000, increaseAfter = 30_000000, - maxInterval = 300_000000 + maxInterval = 600_000000 } } From 19feee881b9120b9632ca9341161266a7a53babf Mon Sep 17 00:00:00 2001 From: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com> Date: Mon, 16 Jan 2023 12:00:37 +0000 Subject: [PATCH 2/3] 4.3.0 --- CHANGELOG.md | 10 ++++++++++ package.yaml | 2 +- simplexmq.cabal | 2 +- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4339314d0..28921a626 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,13 @@ +# 4.3.0 + +SMP server: + +- additional server usage statistics. + +SMP agent: + +- increase retry interval when sending messages after ERR QUOTA. + # 4.2.0 SMP agent and server: diff --git a/package.yaml b/package.yaml index b5d443eaf..d4ed1c127 100644 --- a/package.yaml +++ b/package.yaml @@ -1,5 +1,5 @@ name: simplexmq -version: 4.2.3 +version: 4.3.0 synopsis: SimpleXMQ message broker description: | This package includes <./docs/Simplex-Messaging-Server.html server>, diff --git a/simplexmq.cabal b/simplexmq.cabal index 8903f41e1..cd0571d83 100644 --- a/simplexmq.cabal +++ b/simplexmq.cabal @@ -5,7 +5,7 @@ cabal-version: 1.12 -- see: https://github.com/sol/hpack name: simplexmq -version: 4.2.3 +version: 4.3.0 synopsis: SimpleXMQ message broker description: This package includes <./docs/Simplex-Messaging-Server.html server>, <./docs/Simplex-Messaging-Client.html client> and From 0af6533510f3266cd9410ddb51af0039af7e4269 Mon Sep 17 00:00:00 2001 From: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com> Date: Tue, 17 Jan 2023 12:24:05 +0000 Subject: [PATCH 3/3] rfc: update xftp doc (#609) --- rfcs/2022-12-26-simplex-file-transfer.md | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/rfcs/2022-12-26-simplex-file-transfer.md b/rfcs/2022-12-26-simplex-file-transfer.md index d3acf74c8..a607726fb 100644 --- a/rfcs/2022-12-26-simplex-file-transfer.md +++ b/rfcs/2022-12-26-simplex-file-transfer.md @@ -95,10 +95,12 @@ To send the file, the sender will: - compute SHA512 digest - pad the file to match the whole number of chunks in size, -- encrypt it with a randomly chosen symmetric key and IV (e.g., using NaCL cryptobox), +- encrypt it with a randomly chosen symmetric key and IV (e.g., using NaCL crypto_secretbox), - split into fixed size chunks - upload each chunk to a randomly chosen server. +The sending client should generate more per-recipient keys than the actual number of recipients, possibly rounding up to a power of 2, to conceal the actual number of intended recipients. + Then the sending client will combine addresses of all chunks and other information into "file description", different for each file recipient, that will include: - an encryption key that was used to encrypt the file (the same for all recipients). @@ -106,22 +108,24 @@ Then the sending client will combine addresses of all chunks and other informati - list of chunk descriptions; information for each chunk: - private Ed25519 key to sign commands for file transfer server. - chunk address (server host and chunk ID). + - chunk sha512 digest To reduce the size, chunk descriptions will be grouped by the server host. -This "file description" itself will be sent as a small file. To estimate its size: +This "file description" itself will be sent as a small file over an authenticated channel, to prevent file description modification. To estimate its size: - each chunk \* redundancy per chunk, assuming chunks are grouped per server: - - chunk number in the file - 8 bytes (including any overhead) + - 1-based chunk number in the file - 8 bytes (including any overhead) - Ed25519 key (different for each recipient / chunk combination) - 32 bytes \* 4/3 (base64, assuming text encoding) - chunk ID (different for each recipient) - 64 bytes \* 4/3 + - optional (only in the first chunk occurence) chunk sha512 digests - 64 bytes \* 4/3 - server addresses - say, 128 bytes per server - sha512 digest - 64 bytes \* 4/3 - encryption key - 32 bytes \* 4/3 - IV - 32 bytes \* 4/3 - encoding overhead - say, 256 bytes -For 1gb file, sent via 4 different servers, in 8Mb chunks, with redundancy 2, the size of "file description", assuming text encoding, will be ~34kb (`128 * (8 + 32 + 64) * 2 * 4/3 + 128 * 4 + (64 + 32 + 32) * 4/3 + 256`). +For 1gb file, sent via 4 different servers, in 8Mb chunks, with redundancy 2, the size of "file description", assuming text encoding, will be ~45kb (`128 * (8 + 32 + 64) * 2 * 4/3 + 128 * 64 * 4/3 + 128 * 4 + (64 + 32 + 32) * 4/3 + 256`). File description format (yml): @@ -132,11 +136,12 @@ chunk: 8Mb hash: abc= key: abc= iv: abc= +part_hashes: [def=, def=, def=, def=] parts: - server: xftp://abc=@example1.com - chunks: [1:abc=:def=, 3:abc=:def=] + chunks: [1:abc=:def=:ghi=, 3:abc=:def=:ghi=] - server: xftp://abc=@example2.com - chunks: [2:abc=:def=, 4:abc=:def=] + chunks: [2:abc=:def=:ghi=, 4:abc=:def=:ghi=] - server: xftp://abc=@example3.com chunks: [1:abc=:def=, 4:abc=:def=] - server: xftp://abc=@example4.com