mirror of
https://github.com/farcasterxyz/hub-monorepo.git
synced 2026-04-18 03:00:22 -04:00
chore: Remove some unnecessary log statements (#1206)
This commit is contained in:
@@ -246,7 +246,6 @@ export default class Server {
|
||||
|
||||
private rpcUsers: RpcUsers;
|
||||
private submitMessageRateLimiter: RateLimiterMemory;
|
||||
private syncSnapshotRateLimiter: RateLimiterMemory;
|
||||
private subscribeIpLimiter = new IpConnectionLimiter(SUBSCRIBE_PERIP_LIMIT, SUBSCRIBE_GLOBAL_LIMIT);
|
||||
|
||||
constructor(
|
||||
@@ -286,12 +285,6 @@ export default class Server {
|
||||
points: rateLimitPerMinute,
|
||||
duration: 60,
|
||||
});
|
||||
|
||||
// Rate limit sync status to 2 per minute
|
||||
this.syncSnapshotRateLimiter = new RateLimiterMemory({
|
||||
points: 2,
|
||||
duration: 60,
|
||||
});
|
||||
}
|
||||
|
||||
async start(ip = "0.0.0.0", port = 0): Promise<number> {
|
||||
@@ -519,13 +512,6 @@ export default class Server {
|
||||
const request = call.request;
|
||||
|
||||
(async () => {
|
||||
const rateLimitResult = await rateLimitByIp(peer, this.syncSnapshotRateLimiter);
|
||||
if (rateLimitResult.isErr()) {
|
||||
callback(toServiceError(rateLimitResult.error));
|
||||
logger.warn({ err: rateLimitResult.error }, `RPC call: Rate limit exceeded for ${peer}`);
|
||||
return;
|
||||
}
|
||||
|
||||
const rootHash = (await this.syncEngine?.trie.rootHash()) ?? "";
|
||||
const snapshot = await this.syncEngine?.getSnapshotByPrefix(request.prefix);
|
||||
snapshot?.match(
|
||||
@@ -537,11 +523,9 @@ export default class Server {
|
||||
excludedHashes: snapshot.excludedHashes,
|
||||
});
|
||||
callback(null, snapshotResponse);
|
||||
log.info({ snapshotResponse }, `RPC call: Sending snapshot response to ${peer}`);
|
||||
},
|
||||
(err: HubError) => {
|
||||
callback(toServiceError(err));
|
||||
log.error({ err }, `RPC call: Error sending snapshot response to ${peer}`);
|
||||
},
|
||||
);
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user