Skip to content

Commit 809e826

Browse files
authored
Merge pull request #24 from hoytech/master
[pull] master from hoytech:master
2 parents 370d0c7 + 54da4a7 commit 809e826

File tree

4 files changed

+9
-2
lines changed

4 files changed

+9
-2
lines changed

shell.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
with pkgs;
33
mkShell {
44
buildInputs = [
5-
perl lmdb zstd secp256k1 flatbuffers zlib openssl libuv
5+
perl lmdb zstd secp256k1 flatbuffers_23 zlib openssl libuv
66
];
77
}

src/apps/relay/RelayIngester.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ void RelayServer::ingesterProcessEvent(lmdb::txn &txn, uint64_t connId, std::str
124124

125125
void RelayServer::ingesterProcessReq(lmdb::txn &txn, uint64_t connId, const tao::json::value &arr) {
126126
if (arr.get_array().size() < 2 + 1) throw herr("arr too small");
127-
if (arr.get_array().size() > 2 + 20) throw herr("arr too big");
127+
if (arr.get_array().size() > 2 + cfg().relay__maxReqFilterSize) throw herr("arr too big");
128128

129129
Subscription sub(connId, jsonGetString(arr[1], "REQ subscription id was not a string"), NostrFilterGroup(arr));
130130

src/apps/relay/golpe.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ config:
3838
desc: "Maximum accepted incoming websocket frame size (should be larger than max event)"
3939
default: 131072
4040
noReload: true
41+
- name: relay__maxReqFilterSize
42+
desc: "Maximum number of filters allowed in a REQ"
43+
default: 20
44+
noReload: true
4145
- name: relay__autoPingSeconds
4246
desc: "Websocket-level PING message frequency (should be less than any reverse proxy idle timeouts)"
4347
default: 55

strfry.conf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@ relay {
7575
# Maximum accepted incoming websocket frame size (should be larger than max event) (restart required)
7676
maxWebsocketPayloadSize = 131072
7777

78+
# Maximum number of filters allowed in a REQ
79+
maxReqFilterSize = 20
80+
7881
# Websocket-level PING message frequency (should be less than any reverse proxy idle timeouts) (restart required)
7982
autoPingSeconds = 55
8083

0 commit comments

Comments
 (0)