Skip to content

Commit 11a1b91

Browse files
authored
Remove logs (#212)
Remove logs since they're not needed anymore.
2 parents d5eed16 + 6c910a3 commit 11a1b91

5 files changed

Lines changed: 32 additions & 18 deletions

File tree

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "prerelease",
3+
"comment": "remove logs",
4+
"packageName": "@apibara/evm-rpc",
5+
"email": "francesco@ceccon.me",
6+
"dependentChangeType": "patch"
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "prerelease",
3+
"comment": "remove logs",
4+
"packageName": "@apibara/protocol",
5+
"email": "francesco@ceccon.me",
6+
"dependentChangeType": "patch"
7+
}

packages/evm-rpc/src/stream-config.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,9 @@ export class EvmRpcStream extends RpcStreamConfig<Filter, Block> {
128128
startBlockNumber,
129129
endBlockNumber,
130130
}: FetchCursorRangeArgs): Promise<BlockInfo[]> {
131-
console.log(
132-
`[EVM] fetchCursorRange: start=${startBlockNumber} end=${endBlockNumber}`,
133-
);
131+
// console.log(
132+
// `[EVM] fetchCursorRange: start=${startBlockNumber} end=${endBlockNumber}`,
133+
// );
134134

135135
const requestCount = Number(endBlockNumber - startBlockNumber + 1n);
136136
return await Promise.all(
@@ -164,7 +164,7 @@ export class EvmRpcStream extends RpcStreamConfig<Filter, Block> {
164164
toBlock = newToBlock;
165165
}
166166

167-
console.log(`[EVM] fetchBlockRange: start=${fromBlock} end=${toBlock}`);
167+
// console.log(`[EVM] fetchBlockRange: start=${fromBlock} end=${toBlock}`);
168168

169169
const { logs: logsByBlockNumber, blockNumbers } =
170170
await this.fetchLogsForRangeWithRetry({
@@ -223,7 +223,7 @@ export class EvmRpcStream extends RpcStreamConfig<Filter, Block> {
223223
async fetchHeaderByHash({
224224
blockHash,
225225
}: FetchBlockByHashArgs<Filter>): Promise<FetchBlockByHashResult<Block>> {
226-
console.log(`[EVM] fetchBlockByHash: hash=${blockHash}`);
226+
// console.log(`[EVM] fetchBlockByHash: hash=${blockHash}`);
227227
// Fetch block header and check it matches the expected parent block hash.
228228
const { header } = await this.fetchBlockHeaderByHashWithRetry({
229229
blockHash,

packages/protocol/src/rpc/chain-tracker.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@ export class ChainTracker {
5555
}
5656

5757
updateFinalized(newFinalized: BlockInfo) {
58-
console.log(
59-
`[CT] updateFinalized: new=${newFinalized.blockNumber} old=${this.#finalized.blockNumber}`,
60-
);
58+
// console.log(
59+
// `[CT] updateFinalized: new=${newFinalized.blockNumber} old=${this.#finalized.blockNumber}`,
60+
// );
6161

6262
if (newFinalized.blockNumber < this.#finalized.blockNumber) {
6363
throw new Error("Finalized cursor moved backwards");
@@ -87,7 +87,7 @@ export class ChainTracker {
8787
}
8888

8989
addToCanonicalChain({ blockInfo }: { blockInfo: BlockInfo }) {
90-
console.log(`[CT] addToCanonicalChain: block=${blockInfo.blockNumber}`);
90+
// console.log(`[CT] addToCanonicalChain: block=${blockInfo.blockNumber}`);
9191

9292
const existing = this.#canonical.get(blockInfo.blockNumber);
9393

@@ -120,9 +120,9 @@ export class ChainTracker {
120120
fetchCursorByHash,
121121
fetchCursorRange,
122122
}: UpdateHeadArgs): Promise<UpdateHeadResult> {
123-
console.log(
124-
`[CT] updateHead: new=${newHead.blockNumber} old=${this.#head.blockNumber}`,
125-
);
123+
// console.log(
124+
// `[CT] updateHead: new=${newHead.blockNumber} old=${this.#head.blockNumber}`,
125+
// );
126126

127127
// No changes to the chain.
128128
if (
@@ -205,9 +205,9 @@ export class ChainTracker {
205205
// The new chain is longer and we need the missing blocks.
206206
// This may result in reorgs.
207207

208-
console.log(
209-
`[CT] moving from ${this.#head.blockNumber} to ${newHead.blockNumber} (${newHead.blockNumber - this.#head.blockNumber} blocks)`,
210-
);
208+
// console.log(
209+
// `[CT] moving from ${this.#head.blockNumber} to ${newHead.blockNumber} (${newHead.blockNumber - this.#head.blockNumber} blocks)`,
210+
// );
211211

212212
let currentBlockNumber = this.#head.blockNumber + 1n;
213213

packages/protocol/src/rpc/data-stream.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,9 @@ async function* dataStreamLoop<TFilter, TBlock>(
149149

150150
const finalized = chainTracker.finalized();
151151

152-
console.log(
153-
`[DS] RpcLoop: c=${cursor.orderKey} f=${finalized.orderKey} h=${chainTracker.head().orderKey}`,
154-
);
152+
// console.log(
153+
// `[DS] RpcLoop: c=${cursor.orderKey} f=${finalized.orderKey} h=${chainTracker.head().orderKey}`,
154+
// );
155155

156156
if (cursor.orderKey < finalized.orderKey) {
157157
yield* backfillFinalizedBlocks(state);

0 commit comments

Comments
 (0)