Skip to content

Commit

Permalink
relay.negentropy.enabled config option: set to false to prevent proce…
Browse files Browse the repository at this point in the history
…ssing negentropy messages
  • Loading branch information
hoytech committed Sep 22, 2023
1 parent c9254ad commit 0d88747
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/apps/relay/RelayIngester.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ void RelayServer::runIngester(ThreadPool<MsgIngester>::Thread &thr) {
sendNoticeError(msg->connId, std::string("bad close: ") + e.what());
}
} else if (cmd.starts_with("NEG-")) {
if (!cfg().relay__negentropy__enabled) throw herr("negentropy disabled");

try {
ingesterProcessNegentropy(txn, decomp, msg->connId, arr);
} catch (std::exception &e) {
Expand Down
3 changes: 3 additions & 0 deletions src/apps/relay/golpe.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ config:
default: 2
noReload: true

- name: relay__negentropy__enabled
desc: "Support negentropy protocol messages"
default: true
- name: relay__negentropy__maxSyncEvents
desc: "Maximum records that sync will process before returning an error"
default: 1000000
3 changes: 3 additions & 0 deletions strfry.conf
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,9 @@ relay {
}

negentropy {
# Support negentropy protocol messages
enabled = true

# Maximum records that sync will process before returning an error
maxSyncEvents = 1000000
}
Expand Down

0 comments on commit 0d88747

Please sign in to comment.