Log large requests and reject them

This commit is contained in:
Neil Booth
2016-11-26 09:32:29 +09:00
parent e53f9d7d1f
commit ce642c7b83
+12 -11
View File
@@ -44,17 +44,18 @@ in ElectrumX are very cheap - they consume about 100 bytes of memory
each and are processed efficiently. I feel the defaults are low and each and are processed efficiently. I feel the defaults are low and
encourage you to raise them. encourage you to raise them.
MAX_HIST - maximum number of historical transactions to serve for MAX_SEND - maximum size of a response message to send over the wire,
a single address. The current Electrum protocol requires in bytes. Defaults to 250,000. The current Electrum
address histories be served en-masse or not at all, protocol has a flaw in that address histories must be
an obvious avenue for abuse. This limit is a served all at once or not at all, an obvious avenue for
stop-gap until the protocol is improved to admit abuse. This limit is a stop-gap until the protocol is
incremental history requests. The default value is improved to admit incremental history requests.
2,000 which should be ample for most legitimate Each history entry is appoximately 100 bytes so the
users. Increasing to around 10,000 is likely fine default is equivalent to a history limit of around 2,500
but bear in mind one client can request multiple entries, which should be ample for most legitimate
addresses. I welcome your experiences and suggestions users. Increasing by a single-digit factor is likely fine
for an appropriate value. but bear in mind one client can request history for
multiple addresses.
MAX_SUBS - maximum number of address subscriptions across all MAX_SUBS - maximum number of address subscriptions across all
sessions. Defaults to 250,000. sessions. Defaults to 250,000.
MAX_SESSION_SUBS - maximum number of address subscriptions permitted to a MAX_SESSION_SUBS - maximum number of address subscriptions permitted to a