Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

config: add maxReqFilterSize #133

Merged
merged 2 commits into from
Dec 20, 2024
Merged
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
2 changes: 1 addition & 1 deletion shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
with pkgs;
mkShell {
buildInputs = [
perl lmdb zstd secp256k1 flatbuffers zlib openssl libuv
perl lmdb zstd secp256k1 flatbuffers_23 zlib openssl libuv
];
}
2 changes: 1 addition & 1 deletion src/apps/relay/RelayIngester.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ void RelayServer::ingesterProcessEvent(lmdb::txn &txn, uint64_t connId, std::str

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

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

Expand Down
4 changes: 4 additions & 0 deletions src/apps/relay/golpe.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ config:
desc: "Maximum accepted incoming websocket frame size (should be larger than max event)"
default: 131072
noReload: true
- name: relay__maxReqFilterSize
desc: "Maximum number of filters allowed in a REQ"
default: 20
noReload: true
- name: relay__autoPingSeconds
desc: "Websocket-level PING message frequency (should be less than any reverse proxy idle timeouts)"
default: 55
Expand Down
3 changes: 3 additions & 0 deletions strfry.conf
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ relay {
# Maximum accepted incoming websocket frame size (should be larger than max event) (restart required)
maxWebsocketPayloadSize = 131072

# Maximum number of filters allowed in a REQ
maxReqFilterSize = 20

# Websocket-level PING message frequency (should be less than any reverse proxy idle timeouts) (restart required)
autoPingSeconds = 55

Expand Down
Loading