non-ff should not drop direct lookups
diff vs. 2.3.0 in FloodfillDatabaseLookupMessageHandler:
- if (_facade.shouldBanBurstLookup(dlm.getFrom(), dlm.getReplyTunnel())) {
- if (_log.shouldLog(Log.WARN)) {
- _log.warn("Banning " + dlm.getSearchType() + " lookup request for " + dlm.getSearchKey() + " because requests are being sent extremely fast in a very short time, reply was to: " + dlm.getFrom() + " tunnel: " + dlm.getReplyTunnel());
- _context.statManager().addRateData("netDb.repeatedBurstLookupsDropped", 1);
- }
- _context.banlist().banlistRouter(dlm.getFrom(), " <b>➜</b> Excessive lookup requests, burst", null, null, _context.clock().now() + 4*60*60*1000);
- _context.commSystem().mayDisconnect(dlm.getFrom());
- _context.statManager().addRateData("netDb.lookupsDropped", 1);
+ boolean ourRI = dlm.getSearchKey() != null && dlm.getSearchKey().equals(_context.routerHash());
+ if (!_context.netDb().floodfillEnabled() && (dlm.getReplyTunnel() == null && !ourRI)) {
+ if (_log.shouldLog(Log.WARN))
+ _log.warn("[dbid: " + _facade._dbid
+ + "] Dropping " + dlm.getSearchType()
+ + " lookup request for " + dlm.getSearchKey()
+ + " (we are not a floodfill), reply was to: "
+ + dlm.getFrom() + " tunnel: " + dlm.getReplyTunnel());
+ _context.statManager().addRateData("netDb.nonFFLookupsDropped", 1);
return null;
}
sample logs:
WARN [P reader 4/4] llDatabaseLookupMessageHandler: [dbid: null] Dropping RI lookup request for [Hash: xxx] (we are not a floodfill), reply was to: [Hash: xxx] tunnel: null
WARN [P reader 4/4] llDatabaseLookupMessageHandler: [dbid: null] Dropping EXPL lookup request for [Hash: xxx] (we are not a floodfill), reply was to: [Hash: xxx] tunnel: null
Prior to this change, non-ffs would reply with a DSRM. This allows routers to query any other router and learn new floodfills. This is necessary if, for example, a router has only non-ff RIs stored locally. I believe this is documented in our netdb docs but I'm not sure. But it's now disabled for direct lookups (no reply tunnel).
This change also appears to break exploration completely, for direct lookups.
Please explain the goal of these changes and justify them.