Skip to content

Commit

Permalink
Remove is historic check in web3 service for rpc
Browse files Browse the repository at this point in the history
  • Loading branch information
Mihajlo-Pavlovic committed Dec 19, 2024
1 parent 4a3c055 commit fc617cb
Showing 1 changed file with 6 additions and 22 deletions.
28 changes: 6 additions & 22 deletions src/modules/blockchain/implementation/web3-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,28 +146,12 @@ class Web3Service {
// eslint-disable-next-line no-await-in-loop
await provider.getNetwork();

let isArchiveNode = false;
try {
const block = await provider.getBlock(1);

if (block) {
isArchiveNode = true;
}
} catch (error) {
/* empty */
}

if (isArchiveNode) {
providers.push({
provider,
priority,
weight: 1,
stallTimeout: RPC_PROVIDER_STALL_TIMEOUT,
});
} else {
this.logger.warn(`${rpcEndpoint} RPC is not an Archive Node, skipping...`);
continue;
}
providers.push({
provider,
priority,
weight: 1,
stallTimeout: RPC_PROVIDER_STALL_TIMEOUT,
});

this.logger.debug(
`Connected to the blockchain RPC: ${this.maskRpcUrl(rpcEndpoint)}.`,
Expand Down

0 comments on commit fc617cb

Please sign in to comment.